liyuheng55555 commented on code in PR #13315:
URL: https://github.com/apache/iotdb/pull/13315#discussion_r1734091593


##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/service/DataNode.java:
##########
@@ -449,7 +446,7 @@ private void storeRuntimeConfigurations(
     initTTLInformation(runtimeConfiguration.getAllTTLInformation());
 
     /* Store cluster ID */
-    
IoTDBDescriptor.getInstance().getConfig().setClusterId(runtimeConfiguration.getClusterId());
+    storeClusterID(runtimeConfiguration.getClusterId());

Review Comment:
   After remove the cluster id from DN restart resp, NPE might happen here



##########
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/node/NodeManager.java:
##########
@@ -421,9 +421,11 @@ public TConfigNodeRegisterResp 
registerConfigNode(TConfigNodeRegisterReq req) {
     int nodeId = nodeInfo.generateNextNodeId();
     req.getConfigNodeLocation().setConfigNodeId(nodeId);
     configManager.getProcedureManager().addConfigNode(req);
+    String clusterId = configManager.getClusterManager().getClusterId();
     return new TConfigNodeRegisterResp()
         .setStatus(ClusterNodeStartUtils.ACCEPT_NODE_REGISTRATION)
-        .setConfigNodeId(nodeId);
+        .setConfigNodeId(nodeId)
+        .setClusterId(clusterId);

Review Comment:
   Not quite necessary here, CN's consensus layer will automatically sync 
cluster id



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to