showuon commented on code in PR #14428:
URL: https://github.com/apache/kafka/pull/14428#discussion_r1342668812
##########
raft/src/main/java/org/apache/kafka/raft/LeaderState.java:
##########
@@ -76,9 +85,37 @@ protected LeaderState(
boolean hasAcknowledgedLeader = voterId == localId;
this.voterStates.put(voterId, new ReplicaState(voterId,
hasAcknowledgedLeader));
}
+ this.majority = voters.size() / 2;
this.grantingVoters = Collections.unmodifiableSet(new
HashSet<>(grantingVoters));
this.log = logContext.logger(LeaderState.class);
this.accumulator = Objects.requireNonNull(accumulator, "accumulator
must be non-null");
+ this.fetchTimeoutMs = fetchTimeoutMs;
+ this.fetchTimer = time.timer(fetchTimeoutMs);
+ }
+
+ public boolean hasMajorityFollowerFetchTimeoutExpired(long currentTimeMs) {
Review Comment:
Changed to `hasMajorityFollowerFetchExpired`. Let me know if you have any
better suggestion. Thanks.
--
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]