You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2022/06/02 17:43:12 UTC

[GitHub] [ozone] adoroszlai commented on a diff in pull request #3453: HDDS-6795: EC: PipelineStateMap#addPipeline should not have precondition checks post db updates

adoroszlai commented on code in PR #3453:
URL: https://github.com/apache/ozone/pull/3453#discussion_r888220405


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/placement/algorithms/SCMContainerPlacementRackScatter.java:
##########
@@ -227,6 +227,16 @@ public List<DatanodeDetails> chooseDatanodes(
           placementStatus.expectedPlacementCount();
       throw new SCMException(errorMsg, null);
     }
+    if (nodesRequiredToChoose != chosenNodes.size()) {
+      String reason = "Chosen nodes size: " + chosenNodes
+          .size() + ", but required nodes to choose: " + nodesRequiredToChoose
+          + " do not match.";
+      LOG.warn("Placement policy could not choose the enough nodes."
+              + " {} Available nodes count: {}, Excluded nodes count: {}",
+          reason, totalNodesCount, excludedNodesCount);
+      throw new SCMException(reason,
+          SCMException.ResultCodes.FAILED_TO_FIND_HEALTHY_NODES);
+    }

Review Comment:
   I wonder if `validateContainerPlacement` should verify the number of chosen nodes vs. required nodes (either in base class or this specific subclass).



-- 
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: issues-unsubscribe@ozone.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org