-
Notifications
You must be signed in to change notification settings - Fork 4.8k
HIVE-29522: Prevent cleaner from creating COMPLETED_COMPACTIONS entries for soft-deleted ACID tables #6399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
HIVE-29522: Prevent cleaner from creating COMPLETED_COMPACTIONS entries for soft-deleted ACID tables #6399
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -50,7 +50,7 @@ public MarkCleanedFunction(CompactionInfo info) { | |
| public Void execute(MultiDataSourceJdbcResource jdbcResource) throws MetaException { | ||
| NamedParameterJdbcTemplate jdbcTemplate = jdbcResource.getJdbcTemplate(); | ||
| MapSqlParameterSource param; | ||
| if (!info.isAbortedTxnCleanup()) { | ||
| if (!info.isAbortedTxnCleanup() && !info.isSoftDelete()) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we just add at the top
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If it is not soft delete, we want to add a row to COMPLETED_COMPACTIONS, delete row from
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sorry, updated the snipper, removed NOT |
||
| param = new MapSqlParameterSource() | ||
| .addValue("id", info.id) | ||
| .addValue("succeeded", Character.toString(SUCCEEDED_STATE), Types.CHAR); | ||
|
|
@@ -85,6 +85,10 @@ public Void execute(MultiDataSourceJdbcResource jdbcResource) throws MetaExcepti | |
| */ | ||
| removeCompactionAndAbortRetryEntries(info, jdbcTemplate); | ||
|
|
||
| if (info.isSoftDelete()) { | ||
| return null; | ||
| } | ||
|
|
||
| if (!info.isAbortedTxnCleanup()) { | ||
| // Remove entries from completed_txn_components as well, so we don't start looking there | ||
| // again but only up to the highest write ID include in this compaction job. | ||
|
|
@@ -175,7 +179,7 @@ private void removeCompactionAndAbortRetryEntries(CompactionInfo info, NamedPara | |
| String deleteQuery = """ | ||
| DELETE FROM "COMPACTION_QUEUE" WHERE "CQ_ID" = :id | ||
| """; | ||
| if (!info.isAbortedTxnCleanup()) { | ||
| if (!info.isAbortedTxnCleanup() && !info.isSoftDelete()) { | ||
| deleteQuery += """ | ||
| OR ("CQ_DATABASE" = :db AND "CQ_TABLE" = :table | ||
| AND (:partition is NULL OR "CQ_PARTITION" = :partition) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we set
softDeleteflag inside cleanUsingLocation? i think we call it only in case of DB/table/partitionsoftDeletewe should also skip adding entries for
soft-deletedpartitions