ppatierno commented on code in PR #13525:
URL: https://github.com/apache/kafka/pull/13525#discussion_r1161086345


##########
raft/src/main/java/org/apache/kafka/raft/internals/KafkaRaftMetrics.java:
##########
@@ -63,9 +63,12 @@ public KafkaRaftMetrics(Metrics metrics, String 
metricGrpPrefix, QuorumState sta
         this.numUnknownVoterConnections = 0;
         this.logEndOffset = new OffsetAndEpoch(0L, 0);
 
-        this.currentStateMetricName = metrics.metricName("current-state", 
metricGroupName, "The current state of this member; possible values are leader, 
candidate, voted, follower, unattached");
+        this.currentStateMetricName = metrics.metricName("current-state", 
metricGroupName, "The current state of this member; possible values are leader, 
candidate, voted, follower, unattached, observer");
         Gauge<String> stateProvider = (mConfig, currentTimeMs) -> {
-            if (state.isLeader()) {
+            // a broker, as not being a voter, is always an observer
+            if (state.isObserver()) {
+                return "observer";

Review Comment:
   > In another word, observer is not actually a kind of state
   
   My doubt was about adding a new state at the beginning but then I thought it 
was not worth in the end for how it's used somewhere else.
   
   > I'm thinking, the observer state is more like an another term of follower, 
just it doesn't join voting process.
   
   Yes, agree. So I think your proposal makes more sense, I will apply it.



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

Reply via email to