Skip to content

HIVE-29571: ACID Compaction: Marking the compaction as compacted should happen after its txn got committed#6511

Merged
kuczoram merged 3 commits into
apache:masterfrom
kuczoram:HIVE-29571
May 29, 2026
Merged

HIVE-29571: ACID Compaction: Marking the compaction as compacted should happen after its txn got committed#6511
kuczoram merged 3 commits into
apache:masterfrom
kuczoram:HIVE-29571

Conversation

@kuczoram
Copy link
Copy Markdown
Contributor

@kuczoram kuczoram commented May 27, 2026

What changes were proposed in this pull request?

Change how the compaction gets committed by first committing its txn and just after that mark the compaction as ready for cleaning.

Why are the changes needed?

Currently the markCompacted call and the commitTxn call happens separately. The markCompacted call happens in the AcidCompactionService.compact method while the commitTxn happens in the close() method. This could lead to inconsistent state that the compaction is marked as finished and ready for cleaning, but the compaction transaction is still open.

Does this PR introduce any user-facing change?

No

How was this patch tested?

By unit tests
Ran the following unit tests against the master branch as well to see if there is no regression in these use-cases. They should not be affected by the changes in this patch.

  • testExceptionDuringCompact
  • testWorkerIfIsDynPartAbort
  • testWorkerNotEnoughToCompact
  • testWorkerNotEnoughToCompactNeedsCleaning

…ld happen after its txn got committed - made some fixes and added more tests
Copy link
Copy Markdown
Member

@deniskuzZ deniskuzZ left a comment

Choose a reason for hiding this comment

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

LGTM +1, minor comment

@sonarqubecloud
Copy link
Copy Markdown

@kuczoram kuczoram merged commit 83d98f4 into apache:master May 29, 2026
4 checks passed
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