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 2021/10/26 07:47:50 UTC

[GitHub] [ozone] sky76093016 commented on a change in pull request #2757: HDDS-5820. Intermittent failure in TestPipelinePlacementPolicy#testPickLowestLoadAnchor

sky76093016 commented on a change in pull request #2757:
URL: https://github.com/apache/ozone/pull/2757#discussion_r736243215



##########
File path: hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/PipelinePlacementPolicy.java
##########
@@ -376,8 +378,7 @@ public DatanodeDetails chooseNode(final List<DatanodeDetails> healthyNodes) {
     if (healthyNodes == null || healthyNodes.isEmpty()) {
       return null;
     }
-    DatanodeDetails selectedNode =
-            healthyNodes.get(getRand().nextInt(healthyNodes.size()));
+    DatanodeDetails selectedNode = healthyNodes.get(0);

Review comment:
       Thanks @rakeshadr for reviewing it.
   
   The [LIST](https://github.com/apache/ozone/blob/c5aaad8cdef758a0028e2be11ce0aea47b09011d/hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/PipelinePlacementPolicy.java#L163) before `getRand().next(healthyNodes.size()` is sorted by "LOAD". If you use the existing `getRand().next(healthyNodes.size())`, the existing sorting will be destroyed.




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