rpuch commented on code in PR #1384:
URL: https://github.com/apache/ignite-3/pull/1384#discussion_r1035615781


##########
modules/cluster-management/src/main/java/org/apache/ignite/internal/cluster/management/raft/CmgRaftService.java:
##########
@@ -206,4 +215,29 @@ private ClusterNodeMessage nodeMessage(ClusterNode node) {
                 .port(node.address().port())
                 .build();
     }
+
+    /**
+     * Issues {@code changePeersAsync} request with same peers; learners are 
recalculated based on the current peers (which is same as
+     * CMG nodes) and known logical topology. Any node in the logical topology 
that is not a CMG node constitutes a learner.
+     *
+     * @param term RAFT term in which we operate (used to avoid races when 
changing peers/learners).
+     * @return Future that completes when the request is processed.
+     */
+    public CompletableFuture<Void> updateLearners(long term) {
+        List<Peer> currentPeers = raftService.peers();

Review Comment:
   `raftService.peers()` returns a `List`. We later pass `currentPeers` to 
`changePeersAsync()`, which just iterates over it, so a `List` is fine there. 
And in line 230, we just iterate over this collection.
   
   Why would we want to build a `LinkedHashSet` from it?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to