jsancio commented on code in PR #22505:
URL: https://github.com/apache/kafka/pull/22505#discussion_r3437371997


##########
raft/src/main/java/org/apache/kafka/raft/internals/RemoveVoterHandler.java:
##########
@@ -150,17 +152,21 @@ public CompletableFuture<RemoveRaftVoterResponseData> 
handleRemoveVoterRequest(
             leaderState.appendVotersRecord(newVoters.get(), currentTimeMs),
             time.timer(requestTimeoutMs)
         );
-        leaderState.resetRemoveVoterHandlerState(Errors.UNKNOWN_SERVER_ERROR, 
null, Optional.of(state));
+        
changeVoterState.resetRemoveVoterHandlerState(Errors.UNKNOWN_SERVER_ERROR, 
null, Optional.of(state));
 
         return state.future();
     }
 
-    public void highWatermarkUpdated(LeaderState<?> leaderState) {
-        leaderState.removeVoterHandlerState().ifPresent(current ->
-            leaderState.highWatermark().ifPresent(highWatermark -> {
-                if (highWatermark.offset() > current.lastOffset()) {
+    public void highWatermarkUpdated(LeaderState<?> leaderState, long 
highWatermark) {
+        var changeVoterState = leaderState.changeVoterState();
+
+        changeVoterState
+            .removeVoterHandlerState()
+            .ifPresent(current -> {
+                if (highWatermark > current.lastOffset()) {
                     // VotersRecord with the removed voter was committed; 
complete the RPC
-                    leaderState.resetRemoveVoterHandlerState(Errors.NONE, 
null, Optional.empty());
+                    changeVoterState
+                        .resetRemoveVoterHandlerState(Errors.NONE, null, 
Optional.empty());

Review Comment:
   Sure. I try to keep lines in the raft module to less than 100 characters 
this line combined is only 103 characters.



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

Reply via email to