TaiJuWu commented on code in PR #20318:
URL: https://github.com/apache/kafka/pull/20318#discussion_r2450840044


##########
raft/src/main/java/org/apache/kafka/raft/LeaderState.java:
##########
@@ -188,6 +188,19 @@ public void resetBeginQuorumEpochTimer(long currentTimeMs) 
{
         beginQuorumEpochTimer.reset(beginQuorumEpochTimeoutMs);
     }
 
+    // Leader don't need to send begin quorum requests to replicas which have 
fetched recently.
+    public Set<ReplicaKey> needToSendBeginQuorumRequests(long currentTimeMs) {
+        Set<ReplicaKey> replicaKeys = new HashSet<>();
+        beginQuorumEpochTimer.update(currentTimeMs);
+        for (ReplicaState state : voterStates.values()) {
+            if (currentTimeMs - state.lastFetchTimestamp >= 
beginQuorumEpochTimeoutMs
+                || !state.hasAcknowledgedLeader) {

Review Comment:
   You are right, this is guard code instead of necessary.
   I will remove it.



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