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 2020/02/02 17:22:21 UTC

[GitHub] [hadoop-ozone] xiaoyuyao commented on a change in pull request #516: HDDS-2923 Add fall-back protection for rack awareness in pipeline creation.

xiaoyuyao commented on a change in pull request #516: HDDS-2923 Add fall-back protection for rack awareness in pipeline creation.
URL: https://github.com/apache/hadoop-ozone/pull/516#discussion_r373861618
 
 

 ##########
 File path: hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/PipelinePlacementPolicy.java
 ##########
 @@ -241,29 +269,30 @@ boolean meetCriteria(DatanodeDetails datanodeDetails, int nodesRequired) {
     exclude.add(anchor);
 
     // Choose the second node on different racks from anchor.
-    DatanodeDetails nodeOnDifferentRack = chooseNodeBasedOnRackAwareness(
+    DatanodeDetails nextNode = chooseNodeBasedOnRackAwareness(
         healthyNodes, exclude,
         nodeManager.getClusterNetworkTopologyMap(), anchor);
-    if (nodeOnDifferentRack == null) {
-      LOG.warn("Pipeline Placement: Unable to find 2nd node on different " +
-          "racks that meets the criteria. Required nodes: {}, Found nodes:" +
-          " {}", nodesRequired, results.size());
-      throw new SCMException("Unable to find required number of nodes.",
-          SCMException.ResultCodes.FAILED_TO_FIND_SUITABLE_NODE);
+    if (nextNode == null) {
 
 Review comment:
   NIT: I think we can change to check positive instead and let the for loop handle the remaining node picking naturally. 
   ```
   boolean rackAwareness = false;
   if (nextNode != null) {
     rackAwareness = true;
     results.add(nextNode);
     exclude.add(nextNode);
   }
   ```
   
   
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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