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/09/10 09:11:28 UTC

[GitHub] [iotdb] CRZbulabula commented on a diff in pull request #7264: [IOTDB-4361] Add a precheck in removing datanode

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


##########
confignode/src/main/java/org/apache/iotdb/confignode/procedure/env/DataNodeRemoveHandler.java:
##########
@@ -433,8 +445,28 @@ private TSStatus checkDataNodeExist(RemoveDataNodePlan removeDataNodePlan) {
    */
   private TSStatus checkRegionReplication(RemoveDataNodePlan removeDataNodePlan) {
     TSStatus status = new TSStatus(TSStatusCode.SUCCESS_STATUS.getStatusCode());
-    int removedDataNodeSize = removeDataNodePlan.getDataNodeLocations().size();
+    List<TDataNodeLocation> removedDataNodes = removeDataNodePlan.getDataNodeLocations();
     int allDataNodeSize = configManager.getNodeManager().getRegisteredDataNodeCount();
+    if (NodeInfo.getMinimumDataNode() == 1) {

Review Comment:
   Add annotation in front of this block of code in order to explain the usage.



##########
confignode/src/main/java/org/apache/iotdb/confignode/procedure/env/DataNodeRemoveHandler.java:
##########
@@ -433,8 +445,28 @@ private TSStatus checkDataNodeExist(RemoveDataNodePlan removeDataNodePlan) {
    */
   private TSStatus checkRegionReplication(RemoveDataNodePlan removeDataNodePlan) {
     TSStatus status = new TSStatus(TSStatusCode.SUCCESS_STATUS.getStatusCode());
-    int removedDataNodeSize = removeDataNodePlan.getDataNodeLocations().size();
+    List<TDataNodeLocation> removedDataNodes = removeDataNodePlan.getDataNodeLocations();
     int allDataNodeSize = configManager.getNodeManager().getRegisteredDataNodeCount();
+    if (NodeInfo.getMinimumDataNode() == 1) {

Review Comment:
   We should step into this if statement as long as the schemaReplicationFactor or the dataReplicationFactor equals to 1



-- 
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