ahuang98 commented on code in PR #18240: URL: https://github.com/apache/kafka/pull/18240#discussion_r1900571487
########## raft/src/main/java/org/apache/kafka/raft/FollowerState.java: ########## @@ -75,7 +79,7 @@ public FollowerState( @Override public ElectionState election() { - return ElectionState.withElectedLeader(epoch, leaderId, voters); + return new ElectionState(epoch, OptionalInt.of(leaderId), votedKey, voters); Review Comment: I'll also change Prospective and Unattached's election() to use the static methods. -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org