From 6fb40756d78893f275e091b4666908a9df98a9eb Mon Sep 17 00:00:00 2001 From: sohardforaname Date: Mon, 7 Aug 2023 22:22:27 +0800 Subject: [PATCH 1/2] 'fix-bugs' --- .../java/org/apache/doris/nereids/txn/Transaction.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/txn/Transaction.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/txn/Transaction.java index 94d1aa72702778..e5e2153d68bbe3 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/txn/Transaction.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/txn/Transaction.java @@ -207,6 +207,14 @@ public void executeInsertIntoTableCommand(StmtExecutor executor) { } catch (MetaNotFoundException e) { LOG.warn("Record info of insert load with error {}", e.getMessage(), e); errMsg = "Record info of insert load with error " + e.getMessage(); + } catch (Exception e) { + if (coordinator == null) { + LOG.warn("coordinator is null, maybe the query is forwarded to master node and this node is follower"); + } + StatementBase statement = planner.getCascadesContext().getStatementContext().getParsedStatement(); + if (statement == null) { + LOG.warn("statement is null, maybe the query is parsed at follower node"); + } } // {'label':'my_label1', 'status':'visible', 'txnId':'123'} From 41803dc5e5b8006d5bb35898bf3653ff24a3b983 Mon Sep 17 00:00:00 2001 From: sohardforaname Date: Tue, 15 Aug 2023 21:24:55 +0800 Subject: [PATCH 2/2] 'fix-bugs' --- .../org/apache/doris/nereids/txn/Transaction.java | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/txn/Transaction.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/txn/Transaction.java index e5e2153d68bbe3..994f5e36055f17 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/txn/Transaction.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/txn/Transaction.java @@ -198,7 +198,8 @@ public void executeInsertIntoTableCommand(StmtExecutor executor) { // 2. transaction failed but Config.using_old_load_usage_pattern is true. // we will record the load job info for these 2 cases try { - StatementBase statement = planner.getCascadesContext().getStatementContext().getParsedStatement(); + // the statement parsed by Nereids is saved at executor::parsedStmt. + StatementBase statement = executor.getParsedStmt(); ctx.getEnv().getLoadManager() .recordFinishedLoadJob(labelName, txnId, database.getFullName(), table.getId(), @@ -207,14 +208,6 @@ public void executeInsertIntoTableCommand(StmtExecutor executor) { } catch (MetaNotFoundException e) { LOG.warn("Record info of insert load with error {}", e.getMessage(), e); errMsg = "Record info of insert load with error " + e.getMessage(); - } catch (Exception e) { - if (coordinator == null) { - LOG.warn("coordinator is null, maybe the query is forwarded to master node and this node is follower"); - } - StatementBase statement = planner.getCascadesContext().getStatementContext().getParsedStatement(); - if (statement == null) { - LOG.warn("statement is null, maybe the query is parsed at follower node"); - } } // {'label':'my_label1', 'status':'visible', 'txnId':'123'}