You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "José Armando García Sancio (Jira)" <ji...@apache.org> on 2022/12/10 00:28:00 UTC

[jira] [Created] (KAFKA-14457) Inconsistent in quorum controller fenced broker metric

José Armando García Sancio created KAFKA-14457:
--------------------------------------------------

             Summary: Inconsistent in quorum controller fenced broker metric
                 Key: KAFKA-14457
                 URL: https://issues.apache.org/jira/browse/KAFKA-14457
             Project: Kafka
          Issue Type: Bug
    Affects Versions: 3.3.1, 3.2.3, 3.2.2, 3.2.1, 3.1.2, 3.3.0, 3.1.1, 3.2.0, 3.1.0
            Reporter: José Armando García Sancio
            Assignee: José Armando García Sancio


It is possible for controllers to replay a record twice. This happens when the active controller replays an uncommitted record, resigns and replays the same record when it becomes committed.

The controller handles these transition changes by using timeline data structures and reverting to previous in-memory snapshots.

This functionality is not used when computing the fenced and unfenced metrics. Specifically, the metric can over count when executing this code:
{code:java}
           } else if (prevRegistration == null) {
              if (registration.fenced()) {
                  controllerMetrics.setFencedBrokerCount(controllerMetrics.fencedBrokerCount() + 1);
                  log.info("Added new fenced broker: {}", registration.id());
              } else {
                  controllerMetrics.setActiveBrokerCount(controllerMetrics.activeBrokerCount() + 1);
                  log.info("Added new unfenced broker: {}", registration.id());
              }{code}
From {{ClusterControlManager::updateMetrics.}}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)