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


##########
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:
   The current code already implements the second point:
   
   1. return success and the configuration changes to the new server priority.
   
   Please take a look at RaftConfigurationImpl#hasNoChange



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