Skip to content

Fix testCommitTimeCompactionPreservesDeletedRecords ignoring delete record column#18473

Merged
Jackie-Jiang merged 1 commit into
apache:masterfrom
Jackie-Jiang:fix-commit-time-compaction-delete-record-column
May 12, 2026
Merged

Fix testCommitTimeCompactionPreservesDeletedRecords ignoring delete record column#18473
Jackie-Jiang merged 1 commit into
apache:masterfrom
Jackie-Jiang:fix-commit-time-compaction-delete-record-column

Conversation

@Jackie-Jiang
Copy link
Copy Markdown
Contributor

Summary

testCommitTimeCompactionPreservesDeletedRecords in CommitTimeCompactionIntegrationTest configured deleteRecordColumn via updateTableConfig after addTableConfig had already created each of the three tables. The pre-commit assertion at line 1126 (validatePreCommitState) expects 2 logical records but observes 4, because soft-deleted rows are never filtered out.

Root cause

The upsert metadata manager captures _deleteRecordColumn once at construction time — it is a final field on BasePartitionUpsertMetadataManager (line 89), populated from UpsertContext in BaseTableUpsertMetadataManager#init (BaseTableUpsertMetadataManager.java:125-146). A subsequent updateTableConfig writes the new value to ZooKeeper but does not rebuild the in-memory manager, so the consumer never recognizes the deleted column and the valid-doc bitmap is not narrowed.

This regression dates back to commit 93de8f0dc7 (Add support for commit time compaction with columnMajorBuild, #16769), which refactored the test from setting the delete column on UpsertConfig before setUpTable(...) (the pattern still used in UpsertTableIntegrationTest) to the createUpsertTable(...) + post-create updateTableConfig(...) pattern that doesn't take effect.

Fix

Add an overload of createUpsertTable that accepts an optional deleteRecordColumn and threads it onto the UpsertConfig before addTableConfig. Route the three table-setup blocks in testCommitTimeCompactionPreservesDeletedRecords through the new overload and drop the now-unnecessary post-create setDeleteRecordColumn + updateTableConfig calls. The other tests in the file are unaffected.

…ecord column

The test configured `deleteRecordColumn` via `updateTableConfig` after
`addTableConfig` had already created the table. The upsert metadata manager
captures `_deleteRecordColumn` once during construction (`final` field on
`BasePartitionUpsertMetadataManager`, populated from `UpsertContext` in
`BaseTableUpsertMetadataManager#init`), so a later table-config update writes
ZK but does not reconfigure the in-memory manager. Soft-deleted records were
never filtered out and the pre-commit logical count was 4 instead of 2.

Add an overload of `createUpsertTable` that accepts an optional delete record
column and applies it to the `UpsertConfig` before `addTableConfig`, and route
the three table-setup calls in `testCommitTimeCompactionPreservesDeletedRecords`
through it.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Jackie-Jiang Jackie-Jiang added the flaky-test Tracks a test that intermittently fails label May 12, 2026
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.68%. Comparing base (7fe517a) to head (6cb1ea2).

Additional details and impacted files
@@            Coverage Diff            @@
##             master   #18473   +/-   ##
=========================================
  Coverage     63.68%   63.68%           
  Complexity     1684     1684           
=========================================
  Files          3262     3262           
  Lines        199826   199826           
  Branches      31031    31031           
=========================================
+ Hits         127264   127268    +4     
+ Misses        62414    62408    -6     
- Partials      10148    10150    +2     
Flag Coverage Δ
custom-integration1 100.00% <ø> (ø)
integration 100.00% <ø> (ø)
integration1 100.00% <ø> (ø)
integration2 0.00% <ø> (ø)
java-21 63.68% <ø> (+<0.01%) ⬆️
temurin 63.68% <ø> (+<0.01%) ⬆️
unittests 63.68% <ø> (+<0.01%) ⬆️
unittests1 55.76% <ø> (+<0.01%) ⬆️
unittests2 34.96% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Jackie-Jiang Jackie-Jiang merged commit 91c1c93 into apache:master May 12, 2026
11 checks passed
@Jackie-Jiang Jackie-Jiang deleted the fix-commit-time-compaction-delete-record-column branch May 12, 2026 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

flaky-test Tracks a test that intermittently fails

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants