github-actions[bot] commented on code in PR #68238:
URL: https://github.com/apache/doris/pull/68238#discussion_r4061611094


##########
fe/fe-core/src/main/java/org/apache/doris/datasource/paimon/PaimonMetadataOps.java:
##########
@@ -189,11 +186,20 @@ private void performDropDb(String dbName, boolean 
ifExists, boolean force) throw
         } catch (DatabaseNotEmptyException e) {
             throw new RuntimeException("database " + dbName + " is not empty! 
please check!");
         }
+        return true;
     }
 
     @Override
     public void afterDropDb(String dbName) {
+        Optional<ExternalDatabase<? extends ExternalTable>> db = 
dorisCatalog.getDbForReplay(dbName);
+        // unregisterDatabase evicts the cached database, whose synchronous 
removal listener resets
+        // it to uninitialized and routes exactly one typed SDK invalidation. 
Do not invalidate the
+        // resolved object again here: the second typed call would rescan 
Paimon's SDK keys under
+        // the catalog write fence on every DROP DATABASE and resolved replay.
         dorisCatalog.unregisterDatabase(dbName);
+        if (!db.isPresent()) {

Review Comment:
   [P1] Unregister the resolved database by its canonical local key. 
`getDbForReplay(dbName)` normalizes mode-1/mode-2 names, so an alternate-case 
drop can resolve cached `db` here, while `unregisterDatabase("DB")` performs an 
exact-key eviction and the subsequent name-based Paimon invalidation also 
compares local names exactly. In that case the removal listener never runs, but 
this presence check suppresses the catalog fallback; the leader then journals 
the same spelling and resolved replay leaves the stale database and SDK handles 
too. Use the resolved object's local name (or verify that eviction occurred 
before skipping fallback) and cover alternate-case leader/replay drops. This is 
distinct from the existing SDK table-key case thread because the typed database 
invalidator is never reached.



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