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

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


The following commit(s) were added to refs/heads/master by this push:
     new f915a5554c2 The ConfigNode should restore cluster_name and 
config_node_id at the first step of restart. (#10279)
f915a5554c2 is described below

commit f915a5554c209b50704e632a31268e3c78913eee
Author: YongzaoDan <[email protected]>
AuthorDate: Fri Jun 23 17:50:06 2023 +0800

    The ConfigNode should restore cluster_name and config_node_id at the first 
step of restart. (#10279)
---
 .../java/org/apache/iotdb/confignode/conf/ConfigNodeStartupCheck.java | 4 ++++
 .../src/main/java/org/apache/iotdb/confignode/service/ConfigNode.java | 4 ----
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeStartupCheck.java
 
b/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeStartupCheck.java
index 96198e96205..ba3fc56ceed 100644
--- 
a/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeStartupCheck.java
+++ 
b/confignode/src/main/java/org/apache/iotdb/confignode/conf/ConfigNodeStartupCheck.java
@@ -74,6 +74,10 @@ public class ConfigNodeStartupCheck extends StartupChecks {
     checkGlobalConfig();
     createDirsIfNecessary();
     if (SystemPropertiesUtils.isRestarted()) {
+      /* Always restore ClusterName and ConfigNodeId first */
+      
CONF.setClusterName(SystemPropertiesUtils.loadClusterNameWhenRestarted());
+      
CONF.setConfigNodeId(SystemPropertiesUtils.loadConfigNodeIdWhenRestarted());
+
       SystemPropertiesUtils.checkSystemProperties();
     }
   }
diff --git 
a/confignode/src/main/java/org/apache/iotdb/confignode/service/ConfigNode.java 
b/confignode/src/main/java/org/apache/iotdb/confignode/service/ConfigNode.java
index 9b6dad567f3..b0889ad9cf9 100644
--- 
a/confignode/src/main/java/org/apache/iotdb/confignode/service/ConfigNode.java
+++ 
b/confignode/src/main/java/org/apache/iotdb/confignode/service/ConfigNode.java
@@ -109,10 +109,6 @@ public class ConfigNode implements ConfigNodeMBean {
       if (SystemPropertiesUtils.isRestarted()) {
         LOGGER.info("{} is in restarting process...", 
ConfigNodeConstant.GLOBAL_NAME);
 
-        /* Always restore ClusterName and ConfigNodeId first */
-        
CONF.setClusterName(SystemPropertiesUtils.loadClusterNameWhenRestarted());
-        
CONF.setConfigNodeId(SystemPropertiesUtils.loadConfigNodeIdWhenRestarted());
-
         if (!SystemPropertiesUtils.isSeedConfigNode()) {
           // The non-seed-ConfigNodes should send restart request
           sendRestartConfigNodeRequest();

Reply via email to