Skip to content

HIVE-29522: Prevent cleaner from creating COMPLETED_COMPACTIONS entries for soft-deleted ACID tables#6399

Merged
deniskuzZ merged 2 commits intoapache:masterfrom
VenuReddy2103:HIVE-29522
Apr 17, 2026
Merged

HIVE-29522: Prevent cleaner from creating COMPLETED_COMPACTIONS entries for soft-deleted ACID tables#6399
deniskuzZ merged 2 commits intoapache:masterfrom
VenuReddy2103:HIVE-29522

Conversation

@VenuReddy2103
Copy link
Copy Markdown
Contributor

@VenuReddy2103 VenuReddy2103 commented Mar 31, 2026

What changes were proposed in this pull request?

When a table is soft deleted, MarkCleanedFunction do not add a row in the COMPLETED_COMPACTIONS table.

Why are the changes needed?

When the configuration property hive.acid.createtable.softdelete is set to true, deletion of ACID table data is performed asynchronously by a background cleaner thread.
As part of this process, the cleaner thread removes entry corresponding to the acid table from the COMPACTION_QUEUE and records a completion entry in the COMPLETED_COMPACTIONS table using org.apache.hadoop.hive.metastore.txn.TxnStore#markCleaned().
However, by the time this operation is executed, the associated ACID table has already been deleted (soft-deleted) in HMS. As a result, a COMPLETED_COMPACTIONS entry is created for a table that no longer exists.

Does this PR introduce any user-facing change?

No

How was this patch tested?

Tested manually

@sonarqubecloud
Copy link
Copy Markdown

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.

+1

@deniskuzZ deniskuzZ merged commit d02e3bb into apache:master Apr 17, 2026
6 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