Skip to content

Commit

Permalink
[fix](Export) Clone SessionVariable for each ExportTaskExecutor (#4…
Browse files Browse the repository at this point in the history
…8239)

Problem Summary:

Because each `StmtExecutor` may modify the `SessionVariable`, we should
ensure each ExportTaskExecutor has its own cloned SessionVariable.
  • Loading branch information
BePPPower authored and morningman committed Feb 24, 2025
1 parent e84a554 commit 225af7b
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import org.apache.doris.qe.ConnectContext;
import org.apache.doris.qe.QueryState.MysqlStateType;
import org.apache.doris.qe.StmtExecutor;
import org.apache.doris.qe.VariableMgr;
import org.apache.doris.scheduler.exception.JobException;
import org.apache.doris.scheduler.executor.TransientTaskExecutor;
import org.apache.doris.thrift.TStatusCode;
Expand Down Expand Up @@ -199,7 +200,7 @@ public void cancel() throws JobException {
private AutoCloseConnectContext buildConnectContext() {
ConnectContext connectContext = new ConnectContext();
exportJob.getSessionVariables().setQueryTimeoutS(exportJob.getTimeoutSecond());
connectContext.setSessionVariable(exportJob.getSessionVariables());
connectContext.setSessionVariable(VariableMgr.cloneSessionVariable(exportJob.getSessionVariables()));
// The rollback to the old optimizer is prohibited
// Since originStmt is empty, reverting to the old optimizer when the new optimizer is enabled is meaningless.
connectContext.setEnv(Env.getCurrentEnv());
Expand Down

0 comments on commit 225af7b

Please sign in to comment.