Status
Current state: Accepted
Discussion thread: https://lists.apache.org/thread/yl87h1s484yc09yjo1no46hwpbv0qkwt
JIRA:
-
KAFKA-14114Getting issue details...
STATUS
Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).
Motivation
KIP-500: Replace ZooKeeper with a Self-Managed Metadata Quorum changes the way cluster metadata is stored and managed in a Kafka cluster. It introduces the concept of a replicated log that is maintained using a custom version of the Raft consensus protocol described in KIP-595: A Raft Protocol for the Metadata Quorum. The controller now utilizes this log to persist and broadcast all metadata related actions in the cluster as described in KIP-631: The Quorum-based Kafka Controller.
With these changes in place, the replicated log containing all metadata changes (henceforth called metadata log) is the source of metadata related information for all nodes in the cluster. Any errors that occur while processing the log could lead to the in-memory state for the node becoming inconsistent. It is important that such errors are made visible. The metrics proposed in the following section aim at doing so. These metrics can be used to set up alerts so that affected nodes can be discovered and needed remedial actions can be performed on them.
Public Interfaces
We propose adding the following new metrics:
Name | Description |
---|---|
kafka.server:type=broker-metadata-metrics,name=metadata-apply-error-count | Reports the number of errors encountered by the BrokerMetadataPublisher while applying a new MetadataImage based on the latest MetadataDelta . |
kafka.server:type=broker-metadata-metrics,name=metadata-load-error-count | Reports the number of errors encountered by the BrokerMetadataListener while loading the metadata log and generating a new MetadataDelta based on it. |
kafka.controller:type=KafkaController,name=MetadataErrorCount | Reports the number of times this controller node has encountered an error during metadata log processing |
Proposed Changes
Controllers
The MetadataErrorCount
metric is update for both active and standby controllers. For Active Controllers it is incremented anytime they hit an error in either generating a Metadata log or while applying it to memory. For standby controllers, this metric is incremented when they hit an error in applying the metadata log to memory. This metric will reflect the total count of errors that a controller encountered in metadata log processing since the last restart.
Brokers
The metadata-apply-error-count
metric will be incremented by one every time there is an error in publishing a new MetadataImage
. This metric will reflect the count of cumulative errors since the broker started up.
The metadata-load-error-count
metric will be incremented every time there is an error in loading batches and generating MetadataDelta
from them. This metric will reflect the count of cumulative errors since the broker started up.
Compatibility, Deprecation, and Migration Plan
These will be newly exposed metrics and there will be no impact on existing kafka versions.
Rejected Alternatives
Instead of adding the specific metrics, we could have added a more generic MetadataProcessingErrorCount Metric which would be incremented when either of these (and any other similar) or any other similar errors are hit on both Brokers and Controllers. The downside to this approach would be the loss in granularity on what exactly failed on a given node. The specific metrics are more meaningful and give better control over any alarming that might be setup on these metrics.