TaiJuWu commented on code in PR #20859:
URL: https://github.com/apache/kafka/pull/20859#discussion_r2516668022
##########
raft/src/main/java/org/apache/kafka/raft/KafkaRaftClient.java:
##########
@@ -3356,30 +3366,51 @@ private boolean
shouldSendAddOrRemoveVoterRequest(FollowerState state, long curr
quorumConfig.autoJoin() &&
state.hasUpdateVoterSetPeriodExpired(currentTimeMs);
}
+ private boolean shouldSendAddVoterRequest(FollowerState state, long
currentTimeMs) {
+ return canJoin && autoJoinEnable(state, currentTimeMs);
+ }
+
+ private boolean shouldSendRemoveVoterRequest(FollowerState state, long
currentTimeMs) {
+ final var localReplicaKey = quorum.localReplicaKeyOrThrow();
+ final var voters = partitionState.lastVoterSet();
+
+ if (voters.voterIds().contains(localReplicaKey.id())) {
+ if (autoJoinEnable(state, currentTimeMs)) {
+ canJoin = true;
Review Comment:
I have added comment here, PTAL.
--
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]