dataroaring commented on PR #62064:
URL: https://github.com/apache/doris/pull/62064#issuecomment-4258341966

   Addressed the review feedback about `DatabasePreemptedException` handling in 
`removeDatabase()`:
   
   **Fix (commit 70c3d71):**
   - Added try-catch around `db.getDatabaseName()` in `removeDatabase()` to 
handle `DatabasePreemptedException` on stale/preempted database handles
   - Mirrors the existing cleanup pattern from `openDatabase()`: catch the 
exception, close the stale handle, remove it from `openedDatabases`, and 
continue scanning
   - The `db.close()` inside the catch is also wrapped defensively, since a 
preempted handle may throw during close as well
   - Without this fix, a preempted handle would abort `removeDatabase()` before 
reaching `replicatedEnvironment.removeDatabase(null, dbName)`, leaving old 
journal DBs unremoved
   
   **Test:**
   - Added `testRemoveDatabaseWithPreemptedHandle()` unit test that injects a 
mock preempted database handle (throws on `getDatabaseName()`), verifies 
`removeDatabase()` still completes successfully, and confirms both the stale 
handle and the target database are properly cleaned up
   
   — ThinkOps 🤖


-- 
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]

Reply via email to