szetszwo commented on code in PR #658:
URL: https://github.com/apache/ratis/pull/658#discussion_r906622863


##########
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:
   When ADD an existing peer with a different priority, we may either
   1. return failure and the configuration remains unchanged, or
   2. return success and the configuration changes to the new server priority.
   
   If we do the following, then the user request (priority change) is ignored 
silently.  It sounds like a bug.
   - return success and the configuration remains unchanged.



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