ahuang98 commented on code in PR #19747:
URL: https://github.com/apache/kafka/pull/19747#discussion_r2102793200
##########
raft/src/main/java/org/apache/kafka/raft/KafkaRaftClient.java:
##########
@@ -3149,17 +3139,12 @@ private long pollCandidate(long currentTimeMs) {
// 3) the shutdown timer expires
long minRequestBackoffMs = maybeSendVoteRequests(state,
currentTimeMs);
return Math.min(shutdown.remainingTimeMs(), minRequestBackoffMs);
- } else if (state.isBackingOff()) {
- if (state.isBackoffComplete(currentTimeMs)) {
- logger.info("Transition to prospective after election backoff
has completed");
- transitionToProspective(currentTimeMs);
- return 0L;
- }
- return state.remainingBackoffMs(currentTimeMs);
} else if (state.hasElectionTimeoutExpired(currentTimeMs)) {
logger.info("Election was not granted, transitioning to
prospective");
transitionToProspective(currentTimeMs);
return 0L;
+ } else if (state.isBackingOff()) {
+ return state.remainingElectionTimeMs(currentTimeMs);
Review Comment:
I see, the first thing that `maybeSendVoterRequest` does is verify if the
vote was rejected. Thanks, I'll simplify the logic here
--
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]