ijuma commented on a change in pull request #10393:
URL: https://github.com/apache/kafka/pull/10393#discussion_r608289621



##########
File path: raft/src/main/java/org/apache/kafka/raft/CandidateState.java
##########
@@ -235,6 +240,15 @@ public int epoch() {
         return highWatermark;
     }
 
+    @Override
+    public boolean canGrantVote(int candidateId, boolean isLogUpToDate) {
+        // Still reject vote request even candidateId = localId, Although the 
candidate votes for
+        // itself, this vote is implicit and not "granted".
+        log.debug("Rejecting vote request from candidate {} since we are 
already candidate in epoch {}",
+            candidateId, epoch);

Review comment:
       You could return Optional[String] probably where defined string would be 
the rejection reason. This would mean renaming the methods slightly though.




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to