Skip to content

Conversation

@deniskuzZ
Copy link
Member

@deniskuzZ deniskuzZ commented Jan 27, 2026

What changes were proposed in this pull request?

  1. Replaced assert with an exception in TxnUtils#createValidTxnListForCleaner
  2. Fixed findReadyToClean eligibility condition in ReadyToCleanHandler
    (i.e. CQ_HIGHEST_WRITE_ID < MIN_OPEN_WRITE_ID - 1)
  3. Removed redundant addWriteIdsToMinHistory from AcidCompactionService
  4. Added open transaction validation to the revokeTimedoutWorkers

Why are the changes needed?

Compaction retries triggered by timeouts under an incorrect configuration pose a risk of data loss. If a compaction is re-attempted before the prior attempt has completed or been properly aborted, the Cleaner may observe multiple base directories with the same writeId and erroneously delete all of them.

Does this PR introduce any user-facing change?

No

How was this patch tested?

TestCleanerWithMinHistoryWriteId

@deniskuzZ deniskuzZ changed the title [DRAFT] ACID: Fix Cleaner processing of retried compaction attempts previously killed HIVE-29420: Hive ACID: Cleaner mishandles retries of killed compactions Jan 28, 2026
@deniskuzZ deniskuzZ force-pushed the cleaner-fix branch 2 times, most recently from 58663a0 to e2058e1 Compare January 28, 2026 22:14
@deniskuzZ deniskuzZ requested a review from kuczoram January 29, 2026 10:48
Copy link
Contributor

@kuczoram kuczoram left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot Denys for this patch! Overall it looks good, the test cases also look good. The second testcase indeed can reproduce the issue with the two bases (if the assert is disabled).
I have one question about the SQL query modification.

@sonarqubecloud
Copy link

@deniskuzZ deniskuzZ merged commit c5f0f5b into apache:master Jan 30, 2026
2 checks passed
@deniskuzZ deniskuzZ deleted the cleaner-fix branch January 30, 2026 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants