TaiJuWu commented on code in PR #20318: URL: https://github.com/apache/kafka/pull/20318#discussion_r2300302152
########## raft/src/main/java/org/apache/kafka/raft/KafkaRaftClient.java: ########## @@ -3043,12 +3047,17 @@ private long maybeSendBeginQuorumEpochRequests( ) ); - timeUntilNextBeginQuorumSend = maybeSendRequest( + Set<ReplicaKey> needToSendBeginQuorumRequest = state.needSendBeginQuorumRequestReplicaKey(currentTimeMs); + Set<Integer> needToSendBeginQuorumRequestNode = needToSendBeginQuorumRequest.stream(). + map(ReplicaKey::id).collect(Collectors.toSet()); + + timeUntilNextBeginQuorumSend = maybeSendRequests( currentTimeMs, voters .voterKeys() .stream() .filter(key -> key.id() != quorum.localIdOrThrow()) + .filter(key -> !needToSendBeginQuorumRequestNode.contains(key.id())) Review Comment: I have updated the code and add a new method `equivalentTo` to check two replicaKey because the directions can be empty before KIP-853. -- 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