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

             Summary: Incorrect partition count metrics for kraft controllers
                 Key: KAFKA-14963
                 URL: https://issues.apache.org/jira/browse/KAFKA-14963
             Project: Kafka
          Issue Type: Bug
          Components: controller, kraft
    Affects Versions: 3.4.0
            Reporter: José Armando García Sancio
            Assignee: José Armando García Sancio
             Fix For: 3.4.1


It is possible for the KRaft controller to report more partitions than are 
available in the cluster. This is because the following test fail against 3.4.0:
{code:java}
       @Test
      public void testPartitionCountDecreased() {
          ControllerMetrics metrics = new MockControllerMetrics();
          ControllerMetricsManager manager = new 
ControllerMetricsManager(metrics);          Uuid createTopicId = 
Uuid.randomUuid();
          Uuid createPartitionTopicId = new Uuid(
              createTopicId.getMostSignificantBits(),
              createTopicId.getLeastSignificantBits()
          );
          Uuid removeTopicId = new Uuid(createTopicId.getMostSignificantBits(), 
createTopicId.getLeastSignificantBits());
          manager.replay(topicRecord("test", createTopicId));
          manager.replay(partitionRecord(createPartitionTopicId, 0, 0, 
Arrays.asList(0, 1, 2)));
          manager.replay(partitionRecord(createPartitionTopicId, 1, 0, 
Arrays.asList(0, 1, 2)));
          manager.replay(removeTopicRecord(removeTopicId));
          assertEquals(0, metrics.globalPartitionCount());
      }
{code}



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

Reply via email to