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


##########
fe/fe-core/src/main/java/org/apache/doris/datasource/ExternalMetaCacheMgr.java:
##########
@@ -240,14 +240,24 @@ public void prepareCatalogByEngine(long catalogId, String 
engine) {
     }
 
     public void invalidateCatalog(long catalogId) {
+        CatalogIf<?> catalog = getCatalog(catalogId);
+        invalidateCatalogCaches(catalogId, catalog == null ? null : 
catalog.getName(), "invalidateCatalog",
+                cache -> cache.invalidateCatalogEntries(catalogId));
+    }
+
+    private void invalidateCatalogCaches(long catalogId, String catalogName, 
String operation,
+            Consumer<ExternalMetaCache> invalidation) {
         try {
             try {
                 routeCatalogEngines(catalogId, cache -> safeInvalidate(
-                        cache, catalogId, "invalidateCatalog",
-                        () -> cache.invalidateCatalogEntries(catalogId)));
+                        cache, catalogId, operation, () -> 
invalidation.accept(cache)));
             } finally {
-                // This cache has no catalog-scoped key, so catalog 
invalidation must clear it globally.
-                invalidateSortedPartitionsCache();
+                if (catalogName != null) {
+                    Env.getCurrentEnv().onCatalogChanged(catalogName);

Review Comment:
   Valid; fixed in 8a67b44cd6a7aabc8d00c32f99bff7e6808dea8d. 
`CollectRelation.collectMTMVCandidates()` now copies qualified dependency name 
values while holding the MV read lock, releases that lock, and only then 
resolves the base tables. This removes the MV-to-catalog lock edge while 
retaining synchronous catalog retirement, per-cache failure isolation and the 
existing rewrite-generation barrier.
   
   The earlier local D-06 dismissal is withdrawn: it checked cache construction 
but missed this candidate-collection path. The new bounded concurrency checks 
fail on the previous implementation and pass after the fix, including a single 
external base already present in the QUERY map. Controls also check copied 
names after a concurrent relation mutation, missing dependencies, both MV cache 
variants, the generation increment and stale SQL revisions.
   
   Validation: 18 focused FE classes / 241 cases passed with no failures, 
errors or skips; `build.sh --fe`, integrated Checkstyle and `git diff --check` 
passed. Two solo local review rounds converged; the exact-head receipt is 
https://github.com/apache/doris/pull/63612#issuecomment-6675661863. Remote 
CI/review remains a separate gate.



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