[fix](fe) Fix stale timestamp in CatalogRecycleBin erase daemon#63310
Open
heguanhui wants to merge 1 commit into
Open
[fix](fe) Fix stale timestamp in CatalogRecycleBin erase daemon#63310heguanhui wants to merge 1 commit into
heguanhui wants to merge 1 commit into
Conversation
### What problem does this PR solve? Issue Number: close #xxx Problem Summary: In CatalogRecycleBin.runAfterCatalogReady(), a single currentTimeMs timestamp is captured at the start and shared across erasePartition, eraseTable, and eraseDatabase. Since each erase operation may take significant time (I/O, log writes, lock acquisition), the subsequent erase methods use a stale timestamp for expiry checks, causing cleanup delay for tables and databases. ### Release note Fix stale timestamp issue in CatalogRecycleBin that causes delayed cleanup of tables and databases in the recycle bin. ### Check List (For Author) - Test: Unit Test - Behavior changed: No - Does this need documentation: No
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
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 problem does this PR solve?
Issue Number: close #xxx
Problem Summary:
CatalogRecycleBin.runAfterCatalogReady()capturesSystem.currentTimeMillis()once at the beginning of the method and shares this timestamp acrosserasePartition(),eraseTable(), anderaseDatabase(). Since each erase operation can take significant time (I/O, log writes, lock acquisition), the later methods use a stale timestamp for expiration checks, causing delayed cleanup of tables and databases.For example, if
erasePartitiontakes 5 minutes,eraseTableanderaseDatabasewill use a timestamp that is 5 minutes old, potentially skipping items that became eligible for cleanup during that period.Fix
Each erase method now gets its own fresh
System.currentTimeMillis()call, ensuring accurate expiration checks.Before:
After:
Release note
Fix delayed cleanup of tables and databases in CatalogRecycleBin when partition erasure takes significant time
Check List (For Author)
testEraseUsesFreshCurrentTimeinCatalogRecycleBinTestthat creates a table with 1000 partitions, force-drops them, and verifies that tables and databases with expired recycle times are properly cleaned up even when partition erasure takes time