Skip to content

Commit 53eb81c

Browse files
committed
make sure beginQuorumEpochRequst send to non acks node
1 parent 810ae03 commit 53eb81c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

raft/src/main/java/org/apache/kafka/raft/LeaderState.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,8 @@ public Set<ReplicaKey> needToSendBeginQuorumRequests(long currentTimeMs) {
192192
Set<ReplicaKey> replicaKeys = new HashSet<>();
193193
beginQuorumEpochTimer.update(currentTimeMs);
194194
for (ReplicaState state : voterStates.values()) {
195-
if (beginQuorumEpochTimer.currentTimeMs() - state.lastFetchTimestamp >= beginQuorumEpochTimeoutMs) {
195+
if (beginQuorumEpochTimer.currentTimeMs() - state.lastFetchTimestamp >= beginQuorumEpochTimeoutMs
196+
|| !state.hasAcknowledgedLeader) {
196197
replicaKeys.add(state.replicaKey());
197198
}
198199
}
@@ -963,6 +964,10 @@ private void updateVoterAndObserverStates(VoterSet lastVoterSet) {
963964
kafkaRaftMetrics.updateNumObservers(observerStates.size());
964965
}
965966

967+
private static class VoterState {
968+
969+
}
970+
966971
public static class ReplicaState implements Comparable<ReplicaState> {
967972
private ReplicaKey replicaKey;
968973
private Endpoints listeners;

0 commit comments

Comments
 (0)