This is an automated email from the ASF dual-hosted git repository.
morrysnow pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.1 by this push:
new 1fb96b8f275 branch-2.1: [opt](Nereids) avoid lock failed if async mv
has invalid base info #47771 (#47914)
1fb96b8f275 is described below
commit 1fb96b8f275760af0e72ab23a83f80a96bcf1961
Author: morrySnow <[email protected]>
AuthorDate: Fri Feb 14 17:51:37 2025 +0800
branch-2.1: [opt](Nereids) avoid lock failed if async mv has invalid base
info #47771 (#47914)
pick from master #47771
---
.../src/main/java/org/apache/doris/mtmv/BaseTableInfo.java | 4 ++++
.../apache/doris/nereids/rules/analysis/CollectRelation.java | 11 ++++++++---
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/fe/fe-core/src/main/java/org/apache/doris/mtmv/BaseTableInfo.java
b/fe/fe-core/src/main/java/org/apache/doris/mtmv/BaseTableInfo.java
index 44183c38fef..2f0810c7a72 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/mtmv/BaseTableInfo.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/mtmv/BaseTableInfo.java
@@ -122,6 +122,10 @@ public class BaseTableInfo {
}
}
+ public boolean isValid() {
+ return ctlName != null && dbName != null && tableName != null;
+ }
+
@Override
public boolean equals(Object o) {
if (this == o) {
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/CollectRelation.java
b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/CollectRelation.java
index 24a85356aba..755f6aa9472 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/CollectRelation.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/CollectRelation.java
@@ -204,13 +204,18 @@ public class CollectRelation implements
AnalysisRuleFactory {
mtmv.readMvLock();
try {
for (BaseTableInfo baseTableInfo :
mtmv.getRelation().getBaseTables()) {
- LOG.info("mtmv {} related base table include {}", new
BaseTableInfo(mtmv), baseTableInfo);
+ if (!baseTableInfo.isValid()) {
+ continue;
+ }
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("mtmv {} related base table include {}",
new BaseTableInfo(mtmv), baseTableInfo);
+ }
try {
cascadesContext.getStatementContext().getAndCacheTable(baseTableInfo.toList(),
TableFrom.MTMV);
} catch (AnalysisException exception) {
- LOG.warn("mtmv related base table get err, related
table is "
- + baseTableInfo.toList(),
exception);
+ LOG.warn("mtmv related base table get err, related
table is {}",
+ baseTableInfo.toList(), exception);
}
}
} finally {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]