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


##########
fe/fe-core/src/main/java/org/apache/doris/mtmv/MTMVRelationManager.java:
##########
@@ -79,6 +83,45 @@ public Set<BaseTableInfo> getMtmvsByBaseView(BaseTableInfo 
table) {
         return viewMTMVs.getOrDefault(table, ImmutableSet.of());
     }
 
+    /** Only discard local rewrite plans; replay must not refresh an MV or 
load external metadata. */
+    public void invalidateRewriteCaches(String catalog, String db, String 
table) {
+        Set<BaseTableInfo> affected = Sets.newHashSet();
+        if (table != null) {
+            BaseTableInfo base = new BaseTableInfo(new TableNameInfo(catalog, 
db, table));
+            affected.addAll(getMtmvsByBaseTable(base));

Review Comment:
   Fixed in 44e6c2e79ec0b3dee84c9dc12d8cd7a123b31a8c; also applied to 
branch-4.1 in a713b8585cb2491c295421fd34e85935bebfae9d. Dependency 
replacement/unregistration and invalidation discovery now share a short index 
monitor. Discovery copies affected MV identities and releases the monitor 
before catalog lookups or MV cache invalidation, preserving the 
MV-lock/index-lock order. Latch-controlled tests pause immediately after 
dependency removal and exercise table/database/catalog invalidation for both 
table and view indexes: all six retained stale caches before the fix, and now 
clear both variants and advance the generation. A separate 
blocked-cache-callback test verifies that index updates remain possible while 
invalidation waits. Validation on each branch: 72 focused FE tests, FE build 
(UI disabled), and Checkstyle passed.



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