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


##########
fe/fe-core/src/main/java/org/apache/doris/datasource/ExternalMetaCacheMgr.java:
##########
@@ -246,8 +246,10 @@ public void invalidateCatalog(long catalogId) {
                         cache, catalogId, "invalidateCatalog",
                         () -> cache.invalidateCatalogEntries(catalogId)));
             } finally {
-                // This cache has no catalog-scoped key, so catalog 
invalidation must clear it globally.
-                invalidateSortedPartitionsCache();
+                CatalogIf<?> catalog = getCatalog(catalogId);

Review Comment:
   [P1] Catalog retirement must advance the catalog revision and invalidate 
MTMV rewrite caches. `ExternalCatalog.resetToUninitialized()` calls 
`retireMetadataCaches()`, which reaches `ExternalMetaCacheMgr.removeCatalog`, 
but that method still only retires connector/row-count state and clears sorted 
partitions. The new `Env.onCatalogChanged` callback is present only in 
`invalidateCatalog`; ALTER CATALOG properties and other reset paths therefore 
leave cached MTMV rewrites (and in-flight rewrite generations) associated with 
the old external metadata. Route `removeCatalog` through `Env.onCatalogChanged` 
using the catalog name captured before detachment, or add an equivalent 
callback at the reset caller.



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