jsancio commented on code in PR #17010:
URL: https://github.com/apache/kafka/pull/17010#discussion_r1733173298


##########
raft/src/main/java/org/apache/kafka/raft/KafkaRaftClient.java:
##########
@@ -533,6 +533,11 @@ public void initialize(
         // so there are no unknown voter connections. Report this metric as 0.
         kafkaRaftMetrics.updateNumUnknownVoterConnections(0);
 
+        // increment number of offline voters

Review Comment:
   When the raft client starts the metrics should be zero. Any replica that is 
not the leader should report zero. Only the leader should report a non-zero 
value if there are offline voters.
   
   The best place to implement this is in `LeaderState`. The method 
`updateReplicaState` is called every time a replica successfully fetches from 
the leader. You can update that method to also update the number of offline 
voters.



-- 
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]

Reply via email to