This is an automated email from the ASF dual-hosted git repository. yiguolei pushed a commit to branch branch-2.1 in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.1 by this push: new 53893c6cb05 branch-2.1: [fix](set variable)Set local session variable when set global variable on Observer. #48468 (#48499) 53893c6cb05 is described below commit 53893c6cb05cd6fb6d211bf6e1d91572b3f0e4e3 Author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> AuthorDate: Sat Mar 1 08:48:00 2025 +0800 branch-2.1: [fix](set variable)Set local session variable when set global variable on Observer. #48468 (#48499) Cherry-picked from #48468 Co-authored-by: James <lijib...@selectdb.com> --- .../src/main/java/org/apache/doris/qe/VariableMgr.java | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/VariableMgr.java b/fe/fe-core/src/main/java/org/apache/doris/qe/VariableMgr.java index 40d8901d820..be0f423da3a 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/qe/VariableMgr.java +++ b/fe/fe-core/src/main/java/org/apache/doris/qe/VariableMgr.java @@ -309,28 +309,12 @@ public class VariableMgr { return joiner.toString(); } - // The only difference between setVar and setVarForNonMasterFE - // is that setVarForNonMasterFE will just return if "checkUpdate" throw exception. - // This is because, when setting global variables from Non Master FE, Doris will do following step: - // 1. forward this SetStmt to Master FE to execute. - // 2. Change this SetStmt to "SESSION" level, and execute it again on this Non Master FE. - // But for "GLOBAL only" variable, such ash "password_history", it doesn't allow to set on SESSION level. - // So when doing step 2, "set password_history=xxx" without "GLOBAL" keywords will throw exception. - // So in this case, we should just ignore this exception and return. public static void setVarForNonMasterFE(SessionVariable sessionVariable, SetVar setVar) throws DdlException { VarContext varCtx = getVarContext(setVar.getVariable()); if (varCtx == null) { ErrorReport.reportDdlException(ErrorCode.ERR_UNKNOWN_SYSTEM_VARIABLE, setVar.getVariable()); } - try { - checkUpdate(setVar, varCtx.getFlag()); - } catch (DdlException e) { - if (LOG.isDebugEnabled()) { - LOG.debug("no need to set var for non master fe: {}", setVar.getVariable(), e); - } - return; - } setVarInternal(sessionVariable, setVar, varCtx); } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org