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


##########
raft/src/main/java/org/apache/kafka/raft/internals/KRaftControlRecordStateMachine.java:
##########
@@ -87,14 +91,21 @@ public KRaftControlRecordStateMachine(
         RecordSerde<?> serde,
         BufferSupplier bufferSupplier,
         int maxBatchSizeBytes,
-        LogContext logContext
+        LogContext logContext,
+        KafkaRaftMetrics kafkaRaftMetrics,
+        ExternalKRaftMetrics externalKRaftMetrics
     ) {
         this.log = log;
         this.voterSetHistory = new VoterSetHistory(staticVoterSet, logContext);
         this.serde = serde;
         this.bufferSupplier = bufferSupplier;
         this.maxBatchSizeBytes = maxBatchSizeBytes;
         this.logger = logContext.logger(this.getClass());
+        this.kafkaRaftMetrics = kafkaRaftMetrics;
+        this.externalKRaftMetrics = externalKRaftMetrics;
+        this.staticVoterSet = Optional.ofNullable(staticVoterSet);
+
+        this.staticVoterSet.ifPresent(voters -> 
kafkaRaftMetrics.updateNumVoters(voters.size()));

Review Comment:
   Yes. that's correct. In that case the value of `ignored-static-voters` will 
go from true to false.



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