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


##########
raft/src/test/java/org/apache/kafka/raft/internals/KafkaRaftMetricsTest.java:
##########
@@ -137,14 +137,14 @@ public void shouldRecordNonVoterQuorumState() throws 
IOException {
         state.initialize(new OffsetAndEpoch(0L, 0));
         raftMetrics = new KafkaRaftMetrics(metrics, "raft", state);
 
-        assertEquals("unattached", getMetric(metrics, 
"current-state").metricValue());
+        assertEquals("observer", getMetric(metrics, 
"current-state").metricValue());
         assertEquals((double) -1L, getMetric(metrics, 
"current-leader").metricValue());
         assertEquals((double) -1L, getMetric(metrics, 
"current-vote").metricValue());
         assertEquals((double) 0, getMetric(metrics, 
"current-epoch").metricValue());
         assertEquals((double) -1L, getMetric(metrics, 
"high-watermark").metricValue());
 
         state.transitionToFollower(2, 1);
-        assertEquals("follower", getMetric(metrics, 
"current-state").metricValue());
+        assertEquals("observer", getMetric(metrics, 
"current-state").metricValue());

Review Comment:
   what I was referring here was a broker, which is not part of the controller 
quorum, but it still fetches the metadata topic from the leader controller but 
it is not part of the voters, because it has "broker" role and not part of the 
quorum. Isn't it an "observer"?
   This is also what we get by using the `kafka-metadata-quorum` bin tool which 
shows the brokers in the observer list. The purpose of the PR was kind of 
aligning the tool output with the KRaft current state metric which was not 
reporting a broker as "observer" but as "follower".



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