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


##########
raft/src/main/java/org/apache/kafka/raft/LeaderState.java:
##########
@@ -79,6 +86,39 @@ protected LeaderState(
         this.grantingVoters = Collections.unmodifiableSet(new 
HashSet<>(grantingVoters));
         this.log = logContext.logger(LeaderState.class);
         this.accumulator = Objects.requireNonNull(accumulator, "accumulator 
must be non-null");
+        // use the 1.5x fetch timeout to tolerate some network transition time 
or other IO time.
+        this.fetchTimeoutMs = (int) (fetchTimeoutMs * 1.5);
+        this.fetchTimer = time.timer(fetchTimeoutMs);
+    }
+
+    // Check if the fetchTimer is expired because we didn't receive a valid 
fetch/fetchSnapshot request from the majority of
+    // the voters within fetch timeout.
+    public boolean hasMajorityFollowerFetchExpired(long currentTimeMs) {

Review Comment:
   See my other comment about check quorum and Alyssa's pre-vote KIP. If you 
agree, maybe we should call this `hasCheckQuorumFailed`.



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