murblanc commented on a change in pull request #2179:
URL: https://github.com/apache/lucene-solr/pull/2179#discussion_r552214070



##########
File path: 
solr/core/src/java/org/apache/solr/cluster/placement/plugins/AffinityPlacementFactory.java
##########
@@ -242,6 +260,37 @@ public PlacementPlan computePlacement(Cluster cluster, 
PlacementRequest request,
         }
       }
 
+      if (secondaryCollection != null) {
+        // 2nd phase to allocate required secondary collection replicas
+        Set<Node> secondaryNodes = new HashSet<>();
+        Shard shard1 = secondaryCollection.iterator().next();
+        shard1.replicas().forEach(r -> {
+          secondaryNodes.add(r.getNode());
+        });
+        Set<ReplicaPlacement> secondaryPlacements = new HashSet<>();
+        Set<Node> alreadyAdded = new HashSet<>();

Review comment:
       Can add the nodes directly into `secondaryNodes` and save introducing 
`alreadyAdded`, given the actual placement decisions are captures elsewhere in 
`secondaryPlacements`.




----------------------------------------------------------------
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:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to