wenzhenghu opened a new pull request, #67750: URL: https://github.com/apache/doris/pull/67750
### What problem does this PR solve? Issue Number: close #67303 Related PR: https://github.com/HYDCP/hy-doris/pull/103 Problem Summary: `CatalogRecycleBin` collects expired IDs under a read lock and erases them later under per-item write locks. During that gap, `RECOVER -> DROP` can recycle a new object generation with the same ID, allowing the stale candidate to erase the new generation and write an incorrect erase journal. This change snapshots the recycle-info object and recycle timestamp with each candidate. Under the write lock, it verifies object identity, timestamp, and current expiration before any erase callback, removal, or journal entry. Database, table, and partition paths are all covered. Static review confirmed that the per-item lock scope remains unchanged and that the change does not alter persisted metadata formats, public APIs, configuration, or upgrade behavior. ### Release note Fix `CatalogRecycleBin` to preserve newly recycled databases, tables, and partitions when an erase cycle holds a stale expired candidate. ### Check List (For Author) - Test <!-- At least one of them must be included. --> - [ ] Regression test - [x] Unit Test - `./run-fe-ut.sh --run org.apache.doris.catalog.CatalogRecycleBinTest` (33 tests passed) - `./run-fe-ut.sh --run org.apache.doris.catalog.CatalogRecycleBinTest#testExpiredDatabaseSnapshotDoesNotEraseNewGeneration+testExpiredTableSnapshotDoesNotEraseNewGeneration+testExpiredPartitionSnapshotDoesNotEraseNewGeneration` (3 tests passed) - `mvn -pl fe-core checkstyle:check -DskipTests` - [ ] Manual test (add detailed scripts or steps below) - [ ] No need to test or manual test. Explain why: - [ ] This is a refactor/code format and no logic has been changed. - [ ] Previous test can cover this change. - [ ] No code files have been changed. - [ ] Other reason <!-- Add your reason? --> - Behavior changed: - [ ] No. - [x] Yes. Stale expired candidates are skipped when the same ID has been recycled as a new generation. - Does this need documentation? - [x] No. - [ ] Yes. <!-- Add document PR link here. eg: https://github.com/apache/doris-website/pull/1214 --> ### Check List (For Reviewer who merge this PR) - [ ] Confirm the release note - [ ] Confirm test cases - [ ] Confirm document - [ ] Add branch pick label <!-- Add branch pick label that this PR should merge into --> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
