From 4f91e62cb2ca256403cc0e5331ebc7b7d68f209c Mon Sep 17 00:00:00 2001 From: yangtao555 Date: Thu, 30 Apr 2026 22:41:52 +0800 Subject: [PATCH] [fix](mtmv) Avoid mutating excluded trigger tables --- .../main/java/org/apache/doris/mtmv/MTMVPartitionUtil.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/mtmv/MTMVPartitionUtil.java b/fe/fe-core/src/main/java/org/apache/doris/mtmv/MTMVPartitionUtil.java index 3f8b4aa2ec7716..aea97a2dc875cc 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/mtmv/MTMVPartitionUtil.java +++ b/fe/fe-core/src/main/java/org/apache/doris/mtmv/MTMVPartitionUtil.java @@ -94,6 +94,7 @@ public static boolean isMTMVPartitionSync(MTMVRefreshContext refreshContext, Str Set excludedTriggerTables) throws AnalysisException { MTMV mtmv = refreshContext.getMtmv(); Map> partitionMappings = refreshContext.getByPartitionName(partitionName); + Set excludedTriggerTablesToCheck = Sets.newHashSet(excludedTriggerTables); if (mtmv.getMvPartitionInfo().getPartitionType() != MTMVPartitionType.SELF_MANAGE) { if (MapUtils.isEmpty(partitionMappings)) { LOG.warn("can not found pct partition, partitionName: {}, mtmvName: {}", @@ -104,7 +105,7 @@ public static boolean isMTMVPartitionSync(MTMVRefreshContext refreshContext, Str for (MTMVRelatedTableIf pctTable : pctTables) { Set relatedPartitionNames = partitionMappings.getOrDefault(pctTable, Sets.newHashSet()); // if follow base table, not need compare with related table, only should compare with related partition - excludedTriggerTables.add(TableNameInfoUtils.fromCatalogDb( + excludedTriggerTablesToCheck.add(TableNameInfoUtils.fromCatalogDb( pctTable.getDatabase().getCatalog(), pctTable.getDatabase(), pctTable)); if (!isSyncWithPartitions(refreshContext, partitionName, relatedPartitionNames, pctTable)) { @@ -114,7 +115,7 @@ public static boolean isMTMVPartitionSync(MTMVRefreshContext refreshContext, Str } return isSyncWithAllBaseTables(refreshContext, partitionName, tables, - excludedTriggerTables); + excludedTriggerTablesToCheck); }