kaijchen commented on code in PR #811:
URL: https://github.com/apache/ratis/pull/811#discussion_r1080880732


##########
ratis-server/src/main/java/org/apache/ratis/server/impl/LeaderStateImpl.java:
##########
@@ -685,6 +685,40 @@ private synchronized void 
sendStartLeaderElectionToHigherPriorityPeer(RaftPeerId
     });
   }
 
+  boolean sendStartLeaderElection(FollowerInfo followerInfo, int 
leaderPriority) {
+    final RaftConfigurationImpl conf = server.getRaftConf();
+    final RaftPeerId followerId = followerInfo.getPeer().getId();
+    final RaftPeer follower = conf.getPeer(followerId);
+    if (follower == null) {
+      if (conf.getPeer(followerId, RaftPeerRole.LISTENER) == null) {
+        LOG.error("{} the follower {} is not in the conf {}", this, 
followerId, conf);
+      }
+      return false;
+    }
+    if (follower.getPriority() <= leaderPriority) {
+      return false;

Review Comment:
   Please add a log before this line.



##########
ratis-server/src/main/java/org/apache/ratis/server/impl/LeaderStateImpl.java:
##########
@@ -685,6 +685,40 @@ private synchronized void 
sendStartLeaderElectionToHigherPriorityPeer(RaftPeerId
     });
   }
 
+  boolean sendStartLeaderElection(FollowerInfo followerInfo, int 
leaderPriority) {
+    final RaftConfigurationImpl conf = server.getRaftConf();
+    final RaftPeerId followerId = followerInfo.getPeer().getId();
+    final RaftPeer follower = conf.getPeer(followerId);
+    if (follower == null) {
+      if (conf.getPeer(followerId, RaftPeerRole.LISTENER) == null) {
+        LOG.error("{} the follower {} is not in the conf {}", this, 
followerId, conf);
+      }
+      return false;

Review Comment:
   Please add a log before this line.



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