924060929 commented on code in PR #68238:
URL: https://github.com/apache/doris/pull/68238#discussion_r4067856774
##########
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:
Fixed in 32bf7af6e6e5a9b76800c26b1cdd224f21af4f0e. afterDropDb now evicts a
resolved database by its canonical local name (db.get().getFullName()), so an
alternate-case DROP DATABASE (lower_case_database_names mode 1/2) evicts the
cached entry, fires its removal listener and runs the typed SDK invalidation
instead of suppressing the catalog fallback while leaving the stale object.
When the database cannot be resolved it still does a best-effort exact-key
eviction and then the conservative catalog flush. Added
testAlternateCaseReplayDropUnregistersCanonicalDatabaseAndSdkCache (remote
drop, replay with DB; asserts the SDK handle is gone and the cached database
evicted) and testAlternateCaseLeaderDropEvictsResolvedDatabase (leader
dropDb(DB) evicts the resolved db).
--
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]