You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2022/05/07 09:14:41 UTC

[GitHub] [iotdb] CRZbulabula commented on a diff in pull request #5818: [IOTDB-3108]Optimize register process of datanode

CRZbulabula commented on code in PR #5818:
URL: https://github.com/apache/iotdb/pull/5818#discussion_r867328820


##########
server/src/main/java/org/apache/iotdb/db/service/DataNode.java:
##########
@@ -158,10 +155,21 @@ public void joinCluster() throws StartupException {
         req.setDataNodeLocation(location);
 
         TDataNodeRegisterResp dataNodeRegisterResp = configNodeClient.registerDataNode(req);
+
+        // store config node lists from resp
+        List<TEndPoint> configNodeList = new ArrayList<>();
+        for (TConfigNodeLocation configNodeLocation : dataNodeRegisterResp.getConfigNodeList()) {
+          configNodeList.add(configNodeLocation.getInternalEndPoint());
+        }
+        config.setConfigNodeList(configNodeList);
+        IoTDBConfigCheck.getInstance().serializeConfigNodeList(configNodeList);
+
         if (dataNodeRegisterResp.getStatus().getCode()
                 == TSStatusCode.SUCCESS_STATUS.getStatusCode()
             || dataNodeRegisterResp.getStatus().getCode()
                 == TSStatusCode.DATANODE_ALREADY_REGISTERED.getStatusCode()) {
+          logger.info(
+              "Register current node using request {} with response {}", req, dataNodeRegisterResp);

Review Comment:
   Please print dataNodeRegisterResp.getStatus().getMessage() individually~



-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org