zhang-arvin opened a new pull request, #67308: URL: https://github.com/apache/doris/pull/67308
Closes #67303. ## Problem The eraseTable and erasePartition methods in CatalogRecycleBin had an ABA race condition. They collected expired IDs under a read lock, then iterated over them under a write lock. However, between the read lock release and the write lock acquisition, entries could be re-added with the same ID (e.g., after a table/partition was restored and then dropped again), causing the write lock section to erase the wrong entry. ## Fix - Change the collection phase from List to Map that captures both the ID and the recycle time. - In the write lock section, re-validate that the recycle time hasn't changed and the entry is still expired before erasing. - Use get() then remove() instead of remove() directly, to allow the re-validation step. - Same fix applied to eraseDatabase, eraseTable, and erasePartition. -- 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]
