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

morrysnow pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-3.0 by this push:
     new 38e8cc4bbcf branch-3.0: [fix](variable) force update variable not work 
as expected #45648 (#45695)
38e8cc4bbcf is described below

commit 38e8cc4bbcfb407b0d6b6c8c0ff69ee3b495300e
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Tue Dec 24 14:58:07 2024 +0800

    branch-3.0: [fix](variable) force update variable not work as expected 
#45648 (#45695)
    
    Cherry-picked from #45648
    
    Co-authored-by: morrySnow <zhangwen...@selectdb.com>
---
 fe/fe-core/src/main/java/org/apache/doris/catalog/Env.java    | 2 +-
 fe/fe-core/src/main/java/org/apache/doris/qe/VariableMgr.java | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/Env.java 
b/fe/fe-core/src/main/java/org/apache/doris/catalog/Env.java
index 027d346d0bf..91a45bb71b0 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/catalog/Env.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/Env.java
@@ -2645,7 +2645,7 @@ public class Env {
     }
 
     public void replayGlobalVariableV2(GlobalVarPersistInfo info) throws 
IOException, DdlException {
-        VariableMgr.replayGlobalVariableV2(info);
+        VariableMgr.replayGlobalVariableV2(info, false);
     }
 
     public long saveLoadJobsV2(CountingDataOutputStream dos, long checksum) 
throws IOException {
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 93f931fff12..1305b2944ab 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
@@ -459,21 +459,21 @@ public class VariableMgr {
             }
             variablesToRead.readFields(in);
             GlobalVarPersistInfo info = GlobalVarPersistInfo.read(in);
-            replayGlobalVariableV2(info);
+            replayGlobalVariableV2(info, true);
         } finally {
             wlock.unlock();
         }
     }
 
     // this method is used to replace the `replayGlobalVariable()`
-    public static void replayGlobalVariableV2(GlobalVarPersistInfo info) 
throws DdlException {
+    public static void replayGlobalVariableV2(GlobalVarPersistInfo info, 
boolean fromImage) throws DdlException {
         wlock.lock();
         try {
             String json = info.getPersistJsonString();
             JSONObject root = (JSONObject) JSONValue.parse(json);
             // if not variable version, we set it to 0 to ensure we could 
force set global variable.
             boolean hasVariableVersion = 
root.containsKey(GlobalVariable.VARIABLE_VERSION);
-            if (!hasVariableVersion) {
+            if (fromImage && !hasVariableVersion) {
                 GlobalVariable.variableVersion = 
GlobalVariable.VARIABLE_VERSION_0;
             }
             for (Object varName : root.keySet()) {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to