kevin-wu24 commented on code in PR #19589:
URL: https://github.com/apache/kafka/pull/19589#discussion_r2076214189


##########
raft/src/main/java/org/apache/kafka/raft/KafkaRaftClient.java:
##########
@@ -2280,6 +2280,25 @@ private boolean handleApiVersionsResponse(
         );
     }
 
+    private boolean handleAddVoterResponse(
+        RaftResponse.Inbound responseMetadata,
+        long currentTimeMs
+    ) {
+        RemoveRaftVoterResponseData data = (RemoveRaftVoterResponseData) 
responseMetadata.data();
+
+        Errors error = Errors.forCode(data.errorCode());
+
+        if (error == Errors.NONE || error == Errors.UNSUPPORTED_VERSION || 
error == Errors.DUPLICATE_VOTER) {
+            return true;
+        } else if (error == Errors.REQUEST_TIMED_OUT) {
+            FollowerState follower = quorum.followerStateOrThrow();
+            follower.resetUpdateVoterPeriod(currentTimeMs);
+            return true;

Review Comment:
   I think we discussed this previously. My thinking was that we should reset 
the timer when getting this error because it means one of two things about the 
leader:
   
   1. it has not yet committed its epoch, so it cannot handle add/remove voter 
rpcs yet
   2. it is currently processing an add/remove voter rpc
   
   The idea behind resetting the timer here was to back off the observer for a 
short period of time, which reduces the number of messages in the network while 
the leader is trying to finish one of the above two tasks.



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