From afb5def38560e6a279761e6cbba1be9e34d50fb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A5=95=E5=86=B7?= <82279870+TangSiyang2001@users.noreply.github.com> Date: Sun, 5 Mar 2023 11:03:59 +0800 Subject: [PATCH] [enhancement](timeout) replace query timeout with exec timeout (#17360) --- .../java/org/apache/doris/load/update/UpdateStmtExecutor.java | 2 +- .../main/java/org/apache/doris/qe/MasterCatalogExecutor.java | 2 +- .../src/main/java/org/apache/doris/qe/MasterOpExecutor.java | 4 ++-- .../src/main/java/org/apache/doris/qe/MasterTxnExecutor.java | 4 ++-- .../org/apache/doris/load/update/UpdateStmtExecutorTest.java | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/load/update/UpdateStmtExecutor.java b/fe/fe-core/src/main/java/org/apache/doris/load/update/UpdateStmtExecutor.java index f22905e107..f7148f9b15 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/load/update/UpdateStmtExecutor.java +++ b/fe/fe-core/src/main/java/org/apache/doris/load/update/UpdateStmtExecutor.java @@ -228,7 +228,7 @@ public class UpdateStmtExecutor { updateStmtExecutor.analyzer = updateStmt.getAnalyzer(); updateStmtExecutor.queryId = updateStmtExecutor.analyzer.getContext().queryId(); updateStmtExecutor.timeoutSecond = updateStmtExecutor.analyzer.getContext() - .getSessionVariable().getQueryTimeoutS(); + .getExecTimeout(); updateStmtExecutor.updatePlanner = new UpdatePlanner(updateStmtExecutor.dbId, updateStmtExecutor.targetTable, updateStmt.getSetExprs(), updateStmt.getSrcTupleDesc(), updateStmt.getAnalyzer()); diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/MasterCatalogExecutor.java b/fe/fe-core/src/main/java/org/apache/doris/qe/MasterCatalogExecutor.java index e13d2daefd..099d98b596 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/qe/MasterCatalogExecutor.java +++ b/fe/fe-core/src/main/java/org/apache/doris/qe/MasterCatalogExecutor.java @@ -44,7 +44,7 @@ public class MasterCatalogExecutor { // The method may be called by FrontendServiceImpl from BE, which does not have ConnectContext. waitTimeoutMs = 300 * 1000; } else { - waitTimeoutMs = ctx.getSessionVariable().getQueryTimeoutS() * 1000; + waitTimeoutMs = ctx.getExecTimeout() * 1000; } } diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/MasterOpExecutor.java b/fe/fe-core/src/main/java/org/apache/doris/qe/MasterOpExecutor.java index 412e5533a4..4f0036a6e5 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/qe/MasterOpExecutor.java +++ b/fe/fe-core/src/main/java/org/apache/doris/qe/MasterOpExecutor.java @@ -56,11 +56,11 @@ public class MasterOpExecutor { this.originStmt = originStmt; this.ctx = ctx; if (status.isNeedToWaitJournalSync()) { - this.waitTimeoutMs = ctx.getSessionVariable().getQueryTimeoutS() * 1000; + this.waitTimeoutMs = ctx.getExecTimeout() * 1000; } else { this.waitTimeoutMs = 0; } - this.thriftTimeoutMs = ctx.getSessionVariable().getQueryTimeoutS() * 1000; + this.thriftTimeoutMs = ctx.getExecTimeout() * 1000; // if isQuery=false, we shouldn't retry twice when catch exception because of Idempotency this.shouldNotRetry = !isQuery; } diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/MasterTxnExecutor.java b/fe/fe-core/src/main/java/org/apache/doris/qe/MasterTxnExecutor.java index 0f329b5975..b9d011ae5f 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/qe/MasterTxnExecutor.java +++ b/fe/fe-core/src/main/java/org/apache/doris/qe/MasterTxnExecutor.java @@ -41,8 +41,8 @@ public class MasterTxnExecutor { public MasterTxnExecutor(ConnectContext ctx) { this.ctx = ctx; - this.waitTimeoutMs = ctx.getSessionVariable().getQueryTimeoutS() * 1000; - this.thriftTimeoutMs = ctx.getSessionVariable().getQueryTimeoutS() * 1000; + this.waitTimeoutMs = ctx.getExecTimeout() * 1000; + this.thriftTimeoutMs = ctx.getExecTimeout() * 1000; } private TNetworkAddress getMasterAddress() throws TException { diff --git a/fe/fe-core/src/test/java/org/apache/doris/load/update/UpdateStmtExecutorTest.java b/fe/fe-core/src/test/java/org/apache/doris/load/update/UpdateStmtExecutorTest.java index 242449bf38..2fe3b13e20 100644 --- a/fe/fe-core/src/test/java/org/apache/doris/load/update/UpdateStmtExecutorTest.java +++ b/fe/fe-core/src/test/java/org/apache/doris/load/update/UpdateStmtExecutorTest.java @@ -86,7 +86,7 @@ public class UpdateStmtExecutorTest { result = 1; analyzer.getContext().queryId(); result = new TUniqueId(1, 2); - analyzer.getContext().getSessionVariable().getQueryTimeoutS(); + analyzer.getContext().getExecTimeout(); result = 1000; olapTable.getId(); result = 2;