jsancio commented on code in PR #16670:
URL: https://github.com/apache/kafka/pull/16670#discussion_r1690594173
##########
raft/src/main/java/org/apache/kafka/raft/KafkaRaftClient.java:
##########
@@ -2669,7 +2721,14 @@ private long pollResigned(long currentTimeMs) {
// until either the shutdown expires or an election bumps the epoch
stateTimeoutMs = shutdown.remainingTimeMs();
} else if (state.hasElectionTimeoutExpired(currentTimeMs)) {
- transitionToCandidate(currentTimeMs);
+ if (quorum.isVoter()) {
+ transitionToCandidate(currentTimeMs);
+ } else {
+ // It is posible that the old leader is not a voter in the new
voter set.
Review Comment:
KRaft already logs a message at info level for every state transition:
https://github.com/apache/kafka/blob/trunk/raft/src/main/java/org/apache/kafka/raft/QuorumState.java#L577
--
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]