yujun777 commented on code in PR #62606:
URL: https://github.com/apache/doris/pull/62606#discussion_r3957177466


##########
fe/fe-core/src/main/java/org/apache/doris/alter/Alter.java:
##########
@@ -1279,31 +1294,103 @@ public void processAlterMTMV(AlterMTMV alterMTMV, 
boolean isReplay) {
                     mtmv.alterStatus(alterMTMV.getStatus());
                     break;
                 case ALTER_PROPERTY:
-                    mtmv.alterMvProperties(alterMTMV.getMvProperties());
-                    break;
+                    if (mtmv.isIvm() && 
alterMTMV.getMvProperties().containsKey(
+                            
PropertyAnalyzer.PROPERTIES_EXCLUDED_TRIGGER_TABLES)) {
+                        Set<TableNameInfo> oldExcludedTriggerTables = 
mtmv.getExcludedTriggerTables();
+                        Set<TableNameInfo> newExcludedTriggerTables = 
MTMVPropertyUtil.parseTableNameInfos(
+                                alterMTMV.getMvProperties().get(
+                                        
PropertyAnalyzer.PROPERTIES_EXCLUDED_TRIGGER_TABLES));
+                        updateIvmStreamsForExcludedTables(db, mtmv, 
oldExcludedTriggerTables,

Review Comment:
   Fixed in https://github.com/apache/doris/pull/67665.
   
   The stream transition for an excluded_trigger_tables change is reordered so 
failures cannot leave a half-applied state that is reported as success:
   
   1. create streams of the base tables leaving the excluded set - on failure 
the streams created in this call are dropped again (compensation) and the error 
propagates to the client (a live ALTER PROPERTY now runs through the new 
processAlterMTMVProperty entry point instead of the tolerant replay catch);
   2. apply the property;
   3. best-effort drop the streams of the base tables that just joined the 
excluded set - a failed drop only leaks a stream of a table that is already 
excluded (harmless, stream leaks are a pre-existing risk) and never fails the 
ALTER after the property took effect.
   
   Every step is idempotent, so a retry after a reported failure converges. 
Replay keeps the previous lenient behavior. Two FE UT cases (count-based debug 
points, independent of base-table iteration order) cover the create-failure 
compensation and the drop-failure best effort with multi-table excluded-set 
changes; the full AlterMTMVTest class (24 tests) passes.



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