HIVE-29571: ACID Compaction: Marking the compaction as compacted should happen after its txn got committed#6511
Open
kuczoram wants to merge 3 commits into
Open
HIVE-29571: ACID Compaction: Marking the compaction as compacted should happen after its txn got committed#6511kuczoram wants to merge 3 commits into
kuczoram wants to merge 3 commits into
Conversation
…ld happen after its txn got committed
deniskuzZ
reviewed
May 27, 2026
| commit(); | ||
| } catch (Exception e) { | ||
| abort(); | ||
| if (onAbortAction != null) onAbortAction.run(); |
Member
There was a problem hiding this comment.
i think we should have default onAbortAction = msc.markFailed(CompactionInfo.compactionInfoToStruct(ci))
Member
There was a problem hiding this comment.
onAbortAction here would be probably null
…ld happen after its txn got committed - made some fixes and added more tests
deniskuzZ
reviewed
May 28, 2026
| } | ||
|
|
||
| void markForAbort(ThrowingRunnable action) { | ||
| this.rollbackOnly = true; |
Member
There was a problem hiding this comment.
this might be redundant since we have default
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



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.