From f6aabb2d7e9dd032a32e9fbabe534b873f70c20c Mon Sep 17 00:00:00 2001 From: zhangdong Date: Mon, 18 Nov 2024 20:32:11 +0800 Subject: [PATCH] [fix](mtmv)After failure, one should quickly return to avoid repeated failures (#44174) ### What problem does this PR solve? BuildContext may fail, and we are currently ignoring this error, which may result in repeated failures. We should quickly return Problem Summary: BuildContext may fail, and we are currently ignoring this error, which may result in repeated failures. We should quickly return ### Release note BuildContext may fail, and we are currently ignoring this error, which may result in repeated failures. We should quickly return --- .../java/org/apache/doris/mtmv/MTMVRewriteUtil.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/mtmv/MTMVRewriteUtil.java b/fe/fe-core/src/main/java/org/apache/doris/mtmv/MTMVRewriteUtil.java index 5e17673a06883f..7b7d743a36bc8c 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/mtmv/MTMVRewriteUtil.java +++ b/fe/fe-core/src/main/java/org/apache/doris/mtmv/MTMVRewriteUtil.java @@ -64,10 +64,16 @@ public static Collection getMTMVCanRewritePartitions(MTMV mtmv, Conne res.add(partition); continue; } - try { - if (refreshContext == null) { + if (refreshContext == null) { + try { refreshContext = MTMVRefreshContext.buildContext(mtmv); + } catch (AnalysisException e) { + LOG.warn("buildContext failed", e); + // After failure, one should quickly return to avoid repeated failures + return res; } + } + try { if (MTMVPartitionUtil.isMTMVPartitionSync(refreshContext, partition.getName(), mtmvRelation.getBaseTablesOneLevel(), Sets.newHashSet())) {