diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/ExecuteCommand.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/ExecuteCommand.java index d5260a72cde650..91e7532e3c9157 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/ExecuteCommand.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/ExecuteCommand.java @@ -71,10 +71,12 @@ public void run(ConnectContext ctx, StmtExecutor executor) throws Exception { executor.setParsedStmt(planAdapter); // If it's not a short circuit query or schema version is different(indicates schema changed), // need to do reanalyze and plan - boolean needAnalyze = !executor.getContext().getStatementContext().isShortCircuitQuery() - || (preparedStmtCtx.shortCircuitQueryContext.isPresent() + boolean isShortCircuit = executor.getContext().getStatementContext().isShortCircuitQuery(); + boolean hasShortCircuitContext = preparedStmtCtx.shortCircuitQueryContext.isPresent(); + boolean schemaVersionMismatch = hasShortCircuitContext && preparedStmtCtx.shortCircuitQueryContext.get().tbl.getBaseSchemaVersion() - != preparedStmtCtx.shortCircuitQueryContext.get().schemaVersion); + != preparedStmtCtx.shortCircuitQueryContext.get().schemaVersion; + boolean needAnalyze = !isShortCircuit || schemaVersionMismatch || !hasShortCircuitContext; if (needAnalyze) { // execute real statement preparedStmtCtx.shortCircuitQueryContext = Optional.empty(); diff --git a/fe/fe-core/src/main/java/org/apache/doris/rpc/BackendServiceProxy.java b/fe/fe-core/src/main/java/org/apache/doris/rpc/BackendServiceProxy.java index 830e7da1a7f469..2b725f434b40b3 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/rpc/BackendServiceProxy.java +++ b/fe/fe-core/src/main/java/org/apache/doris/rpc/BackendServiceProxy.java @@ -58,8 +58,10 @@ public class BackendServiceProxy { // use concurrent map to allow access serviceMap in multi thread. private ReentrantLock lock = new ReentrantLock(); - private Executor grpcThreadPool = ThreadPoolManager.newDaemonCacheThreadPool(Config.grpc_threadmgr_threads_nums, + private static Executor grpcThreadPool = ThreadPoolManager.newDaemonCacheThreadPool( + Config.grpc_threadmgr_threads_nums, "grpc_thread_pool", true); + private final Map serviceMap; public BackendServiceProxy() {