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


##########
fe/fe-core/src/main/java/org/apache/doris/datasource/CatalogMgr.java:
##########
@@ -1075,8 +1107,14 @@ public void addExternalPartitions(String catalogName, 
String dbName, String tabl
         if (!(catalog instanceof ExternalCatalog)) {
             throw new DdlException("Only support ExternalCatalog");
         }
+        // Partition events are already committed remotely. Fence the row 
count by cached identity
+        // before any database/table reload can fail and make the 
ignored-not-found path return.
+        Env.getCurrentEnv().getExtMetaCacheMgr()
+                .invalidateRowCountCache(catalog.getId(), dbName, tableName);
         DatabaseIf db = catalog.getDbNullable(dbName);

Review Comment:
   [P2] Skip invalidation for HMS events excluded by catalog filters. In a 
mode-2 HMS catalog that excludes `archived` while `sales` is hot, an ADD 
PARTITION event for `archived.t` still reaches this ignored-not-found branch: 
the event stream is unfiltered, `getDbNullable` cannot find the excluded DB, 
and `invalidateTableByNameOrWider` has no canonical mapping, so it calls 
`invalidateCatalog` and clears `sales` engine and row-count caches. Excluded 
tables in a visible DB similarly flush their sibling tables at DB scope. The 
merge-base branches returned without invalidation; distinguish filtered targets 
from a lost identity before widening the fence, and cover both filters with hot 
unrelated entries.



##########
fe/fe-core/src/main/java/org/apache/doris/datasource/ExternalCatalog.java:
##########
@@ -1152,6 +1201,18 @@ public void replayDropDb(String dbName) {
         }
     }

Review Comment:
   [P2] Clear database names when replaying a legacy mode-2 DROP. An older 
`DropDbInfo` has no `resolvedDbName`, so this branch calls 
`retireUnresolvedDatabaseGeneration()`, which swaps only the object cache. It 
leaves `namesCache` and `lowerCaseToDatabaseName` intact: after an exact-case 
remote DROP, the follower can still show the deleted DB and `buildDbForInit` 
can recreate its local object because it trusts the cached name. The merge-base 
replay removed that name immediately. Invalidate or refresh the name cache for 
this database-DROP fallback and test a populated names cache; the current 
mocked legacy replay test checks only object and engine invalidation.



##########
fe/fe-core/src/main/java/org/apache/doris/datasource/ExternalCatalog.java:
##########
@@ -1247,10 +1320,49 @@ public void unregisterDatabase(String dbName) {
         if (LOG.isDebugEnabled()) {
             LOG.debug("unregister database [{}]", dbName);
         }
-        if (isInitialized()) {
-            metaCache.invalidate(dbName, Util.genIdByName(name, dbName));

Review Comment:
   [P2] Keep a missing IF EXISTS database from flushing the catalog. In mode 2, 
`DROP DATABASE IF EXISTS absent` returns an empty target from Hive, Iceberg, or 
MaxCompute; the existing no-op hook then calls `unregisterDatabase("absent")`. 
Because that name has no mapping, this new branch retires every database object 
and calls `invalidateCatalog`, clearing unrelated engine and row-count caches 
for a command that changed nothing. The merge-base cleanup was name scoped. 
Keep no-op cleanup limited to any retained historical identity, and cover a 
missing target alongside a hot unrelated 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]

Reply via email to