HIVE-29528: Cleanup managed DB dir after async drop#6397
Open
VenuReddy2103 wants to merge 1 commit intoapache:masterfrom
Open
HIVE-29528: Cleanup managed DB dir after async drop#6397VenuReddy2103 wants to merge 1 commit intoapache:masterfrom
VenuReddy2103 wants to merge 1 commit intoapache:masterfrom
Conversation
5d57f9e to
7dc7832
Compare
|
deniskuzZ
reviewed
Apr 1, 2026
| private List<Path> obsoleteDirs; | ||
| private boolean purge; | ||
| private boolean isSoftDelete; | ||
| private boolean sourceOfReplication; |
deniskuzZ
reviewed
Apr 1, 2026
| Path databasePath = new Path(cr.getLocation()).getParent(); | ||
| for (FileStatus status : fs.listStatus(databasePath)) { | ||
| if (status.isDirectory() && | ||
| status.getPath().getName().matches("(.*)" + AcidConstants.SOFT_DELETE_TABLE_PATTERN)) { |
Member
There was a problem hiding this comment.
could you please explain this check? can't we simply by listing the dir count?
deniskuzZ
reviewed
Apr 1, 2026
| } | ||
|
|
||
| public boolean isSoftDelete() { | ||
| return "true".equalsIgnoreCase(getProperty(hive_metastoreConstants.SOFT_DELETE_DATABASE)); |
deniskuzZ
reviewed
Apr 1, 2026
| } | ||
|
|
||
| private void addSoftDeletePropertiesToRequest(EnvironmentContext context, CompactionRequest request) { | ||
| if ("true".equalsIgnoreCase(context.getProperties().get(hive_metastoreConstants.SOFT_DELETE_DATABASE))) { |
Member
There was a problem hiding this comment.
in another pr you have SOFT_DELETE_TABLE, maybe simply
operation: {drop_database, drop_table}
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?
After the cleaner thread finishes deleting ACID table data and directories, the parent managed database directory is also evaluated for cleanup. If the database directory is empty, it is deleted as part of the cleanup process.
Why are the changes needed?
When soft delete is enabled, orphaned database directories remaining indefinitely in the filesystem, leading to potential storage bloat and inconsistencies between HMS metadata and filesystem state.
Does this PR introduce any user-facing change?
No
How was this patch tested?
Tested manually