Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-14963

Incorrect partition count metrics for kraft controllers

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.4.0
    • 3.4.1
    • controller, kraft
    • None

    Description

      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:

             @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());
            }
      

      Attachments

        Issue Links

          Activity

            People

              jsancio José Armando García Sancio
              jsancio José Armando García Sancio
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: