jsancio commented on code in PR #19416: URL: https://github.com/apache/kafka/pull/19416#discussion_r2054236070
########## raft/src/main/java/org/apache/kafka/raft/internals/UpdateVoterHandler.java: ########## @@ -104,26 +111,39 @@ public CompletableFuture<UpdateRaftVoterResponseData> handleUpdateVoterRequest( ); } - // KAFKA-16538 will implement the case when the kraft.version is 0 - // Check that the cluster supports kraft.version >= 1 + // Read the voter set from the log or leader state KRaftVersion kraftVersion = partitionState.lastKraftVersion(); - if (!kraftVersion.isReconfigSupported()) { - return CompletableFuture.completedFuture( - RaftUtil.updateVoterResponse( - Errors.UNSUPPORTED_VERSION, - requestListenerName, - new LeaderAndEpoch( - localId, - leaderState.epoch() - ), - leaderState.leaderEndpoints() - ) - ); - } + final Optional<KRaftVersionUpgrade.Voters> inMemoryVoters; + final Optional<VoterSet> voters; Review Comment: I find that harder to read and understand. I tend to prefer `final` variable when there are multiple initial values since the Java compiler can enforce that all possible initializations are considered. -- 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