TaiJuWu commented on code in PR #20859:
URL: https://github.com/apache/kafka/pull/20859#discussion_r2568505975
##########
raft/src/main/java/org/apache/kafka/raft/KafkaRaftClient.java:
##########
@@ -497,11 +501,31 @@ public void initialize(
kafkaRaftMetrics,
externalKRaftMetrics
);
+
+ // Set up listener to track voter set changes
+ partitionState.setVoterSetChangeListener((offset, voterSet) -> {
+ // We dont need to check high watermark here since it already
check by
+ // hasJoined is not empty.
+ if (nodeId.isPresent() && hasJoined.isPresent()) {
+ ReplicaKey localReplicaKey = ReplicaKey.of(nodeId.getAsInt(),
nodeDirectoryId);
+ if (voterSet.isVoter(localReplicaKey) && !hasJoined.get()) {
+ logger.error("Detected that local node {} has been added
to voter set at offset {}",
Review Comment:
need to change level.
--
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]