ahuang98 commented on code in PR #14428: URL: https://github.com/apache/kafka/pull/14428#discussion_r1343169152
########## 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: I was more suggesting that this method might benefit from a comment which describes behavior. I guess the info log explains it well enough -- 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