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


##########
ratis-server/src/main/java/org/apache/ratis/server/impl/LeaderStateImpl.java:
##########
@@ -364,7 +364,7 @@ private List<FollowerInfo> 
getFollowerInfos(PeerConfiguration peers) {
 
     final Collection<RaftPeer> listeners = 
conf.getAllPeers(RaftPeerRole.LISTENER);
     if (!listeners.isEmpty()) {
-      addSenders(listeners, placeHolderIndex, false);
+      addSenders(listeners, placeHolderIndex, true);

Review Comment:
   @qian0817 , thanks for catching the bug!   Setting `attendVote` to true for 
listeners does not sound correct since they did not attend the vote.  How about 
filter them out in `checkStaging()`?
   
   ```java
   +++ 
b/ratis-server/src/main/java/org/apache/ratis/server/impl/LeaderStateImpl.java
   @@ -762,11 +762,15 @@ class LeaderStateImpl implements LeaderState {
          // it is possible that the bootstrapping is done. Then, fallback to 
UPDATE_COMMIT
          updateCommitEvent.execute();
        } else {
   -      final long commitIndex = 
server.getState().getLog().getLastCommittedIndex();
   +      final ServerState state = server.getState();
   +      final long commitIndex = state.getLog().getLastCommittedIndex();
   +      final Collection<RaftPeerId> listeners = 
state.getRaftConf().getAllPeers(RaftPeerRole.LISTENER).stream()
   +          .map(RaftPeer::getId).collect(Collectors.toSet());
          // check progress for the new followers
          final EnumSet<BootStrapProgress> reports = getLogAppenders()
              .map(LogAppender::getFollower)
              .filter(follower -> !isAttendingVote(follower))
   +          .filter(follower -> !listeners.contains(follower.getId()))
              .map(follower -> checkProgress(follower, commitIndex))
              .collect(Collectors.toCollection(() -> 
EnumSet.noneOf(BootStrapProgress.class)));
          if (reports.contains(BootStrapProgress.NOPROGRESS)) {
   ```



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