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/07/19 06:29:33 UTC

[GitHub] [ozone] adoroszlai commented on a diff in pull request #3606: HDDS-7015. Failures while choosing nodes for creating container

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


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/placement/algorithms/SCMContainerPlacementRackScatter.java:
##########
@@ -143,10 +147,12 @@ public List<DatanodeDetails> chooseDatanodes(
 
     List<Node> toChooseRacks = new LinkedList<>();
     Set<DatanodeDetails> chosenNodes = new LinkedHashSet<>();
-    List<Node> unavailableNodes = new ArrayList<>();
     Set<Node> skippedRacks = new HashSet<>();
     if (excludedNodes != null) {
-      unavailableNodes.addAll(excludedNodes);
+      unavailableNodes.addAll(
+              excludedNodes.stream()
+                      .filter(node->!unavailableNodes.contains(node))
+                      .collect(Collectors.toList()));
     }

Review Comment:
   Since neither `excludedNodes`, nor `unavailableNodes` changes after filling `unavailableNodes` initially, is this second `addAll` call necessary?



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