ahuang98 commented on code in PR #18240:
URL: https://github.com/apache/kafka/pull/18240#discussion_r1894260795


##########
raft/src/main/java/org/apache/kafka/raft/QuorumState.java:
##########
@@ -226,7 +221,7 @@ public void initialize(OffsetAndEpoch logEndOffsetAndEpoch) 
throws IllegalStateE
                     time,
                     election.epoch(),
                     OptionalInt.of(election.leaderId()),
-                    Optional.empty(),
+                    election.optionalVotedKey(),

Review Comment:
   it might not be expected that a state has both leader and voted key state, 
but I think it's better not to lose the state if it does happen to exist.
   
   not an issue for backwards compatibility, older version would lose votedkey 
state but would have leader state and will reject standard votes correctly 
because of that.



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

Reply via email to