This is an automated email from the ASF dual-hosted git repository.

lijibing pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 3ea1b7c5c6f [fix](set variable)Set local session variable when set 
global variable on Observer. (#48468)
3ea1b7c5c6f is described below

commit 3ea1b7c5c6ff350fce4eb29d14440d4e3089e0ac
Author: James <[email protected]>
AuthorDate: Fri Feb 28 21:42:39 2025 +0800

    [fix](set variable)Set local session variable when set global variable on 
Observer. (#48468)
    
    When set global var in Observer, after forward the op to Master, it
    doesn't set local session variable in Observer. Because checkUpdate
    function doesn't allow set global var in Observer. This pr is to remove
    the checkUpdate so that local var in Observer could be set. Here we
    don't need to do checkUpdate, because we only change the local variable,
    not change the default value nor write any edit log.
---
 .../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 82486fb72c7..7b5c717d381 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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to