[enhancement](timeout) replace query timeout with exec timeout (#17360)

This commit is contained in:
奕冷
2023-03-05 11:03:59 +08:00
committed by GitHub
parent 59bf305c5d
commit afb5def385
5 changed files with 7 additions and 7 deletions

View File

@ -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());

View File

@ -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;
}
}

View File

@ -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;
}

View File

@ -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 {

View File

@ -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;