Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).

Motivation

Zookeeper Pre-Kraft brokers currently register 0 for every controller metric. They do this because in the case of a controller failover, the metrics of a newly elected controller will no longer be 0. KRaft does not have this issue because processes with the "broker" role are never elected as the active controllernot eligible to become controllers. There is some performance overhead associated with registering metrics, so moving forward it would be best if KRaft brokers do not expose controller metrics.

...

The behavior of which nodes register expose controller metrics will change for be different in KRaft clusters than the behavior when using Kafka with Zookeeper. KRaft nodes to will only expose the controller metrics on the controllers. The controller metrics are calculated as metadata records are replayed e.g. OfflinePartitionCount is calculated as PartitionRecord and PartitionChangeRecord are replayed by the active controller. If the controller is a standby, it will expose 0 for the metric since it has not replayed any metadata records yet. 

Proposed Changes

Zookeeper Pre-Kraft brokers expose 0 for controller metrics unless they are the active controller. KRaft brokers should not since they are not controller eligible.

Compatibility, Deprecation, and Migration Plan

...