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


##########
ratis-server/src/main/java/org/apache/ratis/server/impl/VoteContext.java:
##########
@@ -131,6 +132,9 @@ RaftPeer recognizeCandidate(long candidateTerm) {
    * See Section 5.4.1 Election restriction
    */
   boolean decideVote(RaftPeer candidate, TermIndex candidateLastEntry) {
+    if (impl.getRole().getCurrentRole() == RaftProtos.RaftPeerRole.LISTENER) {
+      return reject("The server " + impl.getId() + " is listener and should 
not participate in elections");

Review Comment:
   @codings-dan , thanks a lot for working on this!  The id is already printed 
inside `reject(..)`.  How about changing the message to the following?
   ```java
    return reject("this server is a listener, who is a non-voting member");
   ```
   



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