Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2647,7 +2647,7 @@ public long saveGlobalVariable(CountingDataOutputStream dos, long checksum) thro
}

public void replayGlobalVariableV2(GlobalVarPersistInfo info) throws IOException, DdlException {
VariableMgr.replayGlobalVariableV2(info);
VariableMgr.replayGlobalVariableV2(info, false);
}

public long saveLoadJobsV2(CountingDataOutputStream dos, long checksum) throws IOException {
Expand Down
6 changes: 3 additions & 3 deletions fe/fe-core/src/main/java/org/apache/doris/qe/VariableMgr.java
Original file line number Diff line number Diff line change
Expand Up @@ -459,21 +459,21 @@ public static void read(DataInputStream in) throws IOException, DdlException {
}
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()) {
Expand Down
Loading