codings-dan commented on code in PR #658:
URL: https://github.com/apache/ratis/pull/658#discussion_r905071143


##########
ratis-server/src/main/java/org/apache/ratis/server/impl/RaftServerImpl.java:
##########
@@ -1109,10 +1110,21 @@ public CompletableFuture<RaftClientReply> 
setConfigurationAsync(SetConfiguration
         return pending.getFuture();
       }
 
-      getRaftServer().addRaftPeers(peersInNewConf);
-      // add staging state into the leaderState
-      pending = leaderState.startSetConfiguration(request);
+      if(request.getMode() == SetConfigurationRequest.Mode.ADD) {
+         List<RaftPeer> peers = Stream.of(peersInNewConf, new 
ArrayList<>(current.getAllPeers()))
+            .flatMap(List :: stream).distinct().collect(Collectors.toList());

Review Comment:
   emm, I think if the new peer already exists in the current peer list, we 
could return success, I have change the related code, PTAL, thank you!



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