codings-dan commented on a change in pull request #614:
URL: https://github.com/apache/ratis/pull/614#discussion_r817630723



##########
File path: 
ratis-server/src/main/java/org/apache/ratis/server/impl/LeaderStateImpl.java
##########
@@ -362,22 +362,27 @@ PendingRequest 
startSetConfiguration(SetConfigurationRequest request) {
     Preconditions.assertTrue(running && !inStagingState());
 
     final List<RaftPeer> peersInNewConf = request.getPeersInNewConf();
+    final List<RaftPeer> listenersInNewConf = request.getListenersInNewConf();
     final Collection<RaftPeer> peersToBootStrap = 
server.getRaftConf().filterNotContainedInConf(peersInNewConf);
+    final Collection<RaftPeer> listenersToBootStrap =
+        
server.getRaftConf().filterListenerNotContainedInConf(listenersInNewConf);
 
     // add the request to the pending queue
     final PendingRequest pending = pendingRequests.addConfRequest(request);
 
     ConfigurationStagingState configurationStagingState = new 
ConfigurationStagingState(
-        peersToBootStrap, new PeerConfiguration(peersInNewConf));
+        peersToBootStrap, listenersToBootStrap, new 
PeerConfiguration(peersInNewConf, listenersInNewConf));
     Collection<RaftPeer> newPeers = configurationStagingState.getNewPeers();
+    Collection<RaftPeer> newListeners = 
configurationStagingState.getNewListeners();
     // set the staging state
     this.stagingState = configurationStagingState;
 
-    if (newPeers.isEmpty()) {
+    if (newPeers.isEmpty() && newListeners.isEmpty()) {
       applyOldNewConf();
     } else {
       // update the LeaderState's sender list
       addAndStartSenders(newPeers);
+      addAndStartListeners(newListeners);

Review comment:
       We may think the logic and change it in the next pull request

##########
File path: 
ratis-client/src/main/java/org/apache/ratis/client/impl/AdminImpl.java
##########
@@ -38,13 +39,19 @@
 
   @Override
   public RaftClientReply setConfiguration(List<RaftPeer> peersInNewConf) 
throws IOException {
+    return setConfiguration(peersInNewConf, Collections.emptyList());
+  }

Review comment:
       done

##########
File path: ratis-client/src/main/java/org/apache/ratis/client/api/AdminApi.java
##########
@@ -30,14 +30,25 @@
  * such as setting raft configuration and transferring leadership.
  */
 public interface AdminApi {
-  /** Set the configuration request to the raft service. */
+
   RaftClientReply setConfiguration(List<RaftPeer> serversInNewConf) throws 
IOException;
 
+  /** Set the configuration request to the raft service. */
+  RaftClientReply setConfiguration(List<RaftPeer> serversInNewConf, 
List<RaftPeer> listenersInNewConf)
+      throws IOException;
+
   /** The same as setConfiguration(Arrays.asList(serversInNewConf)). */
-  default RaftClientReply setConfiguration(RaftPeer[] serversInNewConf) throws 
IOException {
+  default RaftClientReply setConfiguration(RaftPeer[] serversInNewConf)
+      throws IOException {

Review comment:
       done

##########
File path: ratis-client/src/main/java/org/apache/ratis/client/api/AdminApi.java
##########
@@ -30,14 +30,25 @@
  * such as setting raft configuration and transferring leadership.
  */
 public interface AdminApi {
-  /** Set the configuration request to the raft service. */
+

Review comment:
       done




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