ahuang98 commented on code in PR #14428: URL: https://github.com/apache/kafka/pull/14428#discussion_r1337653712
########## 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: nit: these are pretty lengthy and arguably unintuitive method names, could we add a short comment on what each method does? -- 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