Skip to content

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

Open
kuczoram wants to merge 1 commit into
apache:masterfrom
kuczoram:HIVE-29571
Open

HIVE-29571: ACID Compaction: Marking the compaction as compacted should happen after its txn got committed#6511
kuczoram wants to merge 1 commit into
apache:masterfrom
kuczoram:HIVE-29571

Conversation

@kuczoram
Copy link
Copy Markdown
Contributor

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 test

commit();
} catch (Exception e) {
abort();
if (onAbortAction != null) onAbortAction.run();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

i think we should have default onAbortAction = msc.markFailed(CompactionInfo.compactionInfoToStruct(ci))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

onAbortAction here would be probably null

@sonarqubecloud
Copy link
Copy Markdown

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