924060929 commented on code in PR #68196:
URL: https://github.com/apache/doris/pull/68196#discussion_r4140097315


##########
fe/fe-core/src/main/java/org/apache/doris/catalog/RefreshManager.java:
##########
@@ -300,6 +385,24 @@ private void 
invalidatePaimonCatalogForUnresolvedReplay(ExternalCatalog catalog)
         }
     }
 
+    private void invalidateColdReplayDatabase(ExternalCatalog catalog, 
ExternalObjectLog log) {
+        Optional<Pair<String, Long>> identity = 
catalog.getDbIdentityForReplay(log.getDbName(), log.getDbId());

Review Comment:
   Fixed in 43a27b06fa0. A cold mode-2 replay whose logged database spelling 
has rebound now opens a catalog row-count generation fence, invalidates the 
resolved current DB, retires Paimon's SDK catalog (including SDK-only handles 
under the old spelling), and closes the row-count admission window. A real 
Paimon Foo -> FOO rebound test proves the old SDK-only handle is gone; 
RefreshManagerTest checks fence ordering.



##########
fe/fe-core/src/main/java/org/apache/doris/datasource/ExternalRowCountCache.java:
##########
@@ -120,19 +330,35 @@ static Optional<Long> loadRowCount(RowCountKey 
rowCountKey, boolean fillMetaCach
      * @return Cached row count or -1 if not exist
      */
     public long getCachedRowCount(long catalogId, long dbId, long tableId, 
boolean fillMetaCache) {
-        RowCountKey key = new RowCountKey(catalogId, dbId, tableId);
         try {
-            CompletableFuture<Optional<Long>> f = fillMetaCache
-                    ? rowCountCache.get(key, (rowCountKey, executor) -> 
CompletableFuture.supplyAsync(
-                            () -> loadRowCount(rowCountKey, true), executor))
-                    : rowCountCache.get(key);
+            CompletableFuture<Optional<Long>> f;
+            long generation;
+            long dbGeneration;
+            publicationLock.readLock().lock();
+            try {
+                generation = currentCatalogGeneration(catalogId);

Review Comment:
   Fixed in 43a27b06fa0. A retained table can indeed issue a post-DROP read and 
recreate a generation. The catalog-generation registry is now Caffeine-bounded 
at the row-count cache limit; every recreated or evicted generation gets a 
globally unique number, so old row counts remain unreachable without retaining 
unbounded catalog IDs. The late-read test exercises repeated DROP/read overlap 
with a two-entry generation limit.



##########
fe/fe-core/src/main/java/org/apache/doris/datasource/metacache/MetaCache.java:
##########
@@ -553,6 +553,20 @@ public Optional<T> getMetaObjById(long id) {
         return name == null ? Optional.empty() : getMetaObj(name, id);
     }
 
+    /** Return the retained canonical name without loading an evicted metadata 
object. */
+    public Optional<String> getNameByIdIfPresent(long id) {
+        return Optional.ofNullable(withMetaObjLifecycleReadLock(() -> 
idToName.get(id)));
+    }
+
+    /** Snapshot resident object identities matching a DROP alias under the 
catalog's name mode. */
+    public List<Pair<String, Long>> getCachedIdentitiesMatching(String name, 
boolean ignoreCase) {
+        return withMetaObjLifecycleReadLock(() -> idToName.entrySet().stream()
+                .filter(entry -> ignoreCase ? 
entry.getValue().equalsIgnoreCase(name)

Review Comment:
   Fixed in 43a27b06fa0. Resident no-op DROP matching now uses Locale.ROOT 
folding, the same rule as catalog name lookup, instead of equalsIgnoreCase. 
CatalogMgrTest verifies that a no-op DROP of dotless ı leaves the cached I 
database intact while a matching historical alias still retires narrowly.



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