diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java b/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java index 6eaeb559b7343c..b9c003eff93b03 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java +++ b/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java @@ -725,6 +725,7 @@ private void executeByNereids(TUniqueId queryId) throws Exception { return; } } + syncJournalIfNeeded(); try { ((Command) logicalPlan).run(context, this); } catch (MustFallbackException e) { @@ -759,6 +760,7 @@ private void executeByNereids(TUniqueId queryId) throws Exception { } else { context.getState().setIsQuery(true); // create plan + syncJournalIfNeeded(); planner = new NereidsPlanner(statementContext); if (context.getSessionVariable().isEnableMaterializedViewRewrite()) { planner.addHook(InitMaterializationContextHook.INSTANCE); @@ -805,7 +807,6 @@ public void finalizeQuery() { private void handleQueryWithRetry(TUniqueId queryId) throws Exception { // queue query here - syncJournalIfNeeded(); int retryTime = Config.max_query_retry_time; for (int i = 0; i <= retryTime; i++) { try { @@ -955,6 +956,7 @@ public void executeByLegacy(TUniqueId queryId) throws Exception { } } } else { + syncJournalIfNeeded(); analyzer = new Analyzer(context.getEnv(), context); parsedStmt.analyze(analyzer); parsedStmt.checkPriv();