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

ZkAdminManager.describeConfigs returns no config when 2+ configuration keys are specified

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 2.7.0
    • 2.8.0, 2.7.1
    • core

    Description

      When ZkAdminManager.describeConfigs receives DescribeConfigsResource with 2 or more configurationKeys specified, it returns an empty configuration.

      Here's a test for ZkAdminManagerTest that reproduces this issue:
       

      @Test
      def testDescribeConfigsWithConfigurationKeys(): Unit = {
        EasyMock.expect(zkClient.getEntityConfigs(ConfigType.Topic, topic)).andReturn(TestUtils.createBrokerConfig(brokerId, "zk"))
        EasyMock.expect(metadataCache.contains(topic)).andReturn(true)
      
        EasyMock.replay(zkClient, metadataCache)
      
        val resources = List(new DescribeConfigsRequestData.DescribeConfigsResource()
          .setResourceName(topic)
          .setResourceType(ConfigResource.Type.TOPIC.id)
          .setConfigurationKeys(List("retention.ms", "retention.bytes", "segment.bytes").asJava)
        )
      
        val adminManager = createAdminManager()
        val results: List[DescribeConfigsResponseData.DescribeConfigsResult] = adminManager.describeConfigs(resources, true, true)
        assertEquals(Errors.NONE.code, results.head.errorCode())
        val resultConfigKeys = results.head.configs().asScala.map(r => r.name()).toSet
        assertEquals(Set("retention.ms", "retention.bytes", "segment.bytes"), resultConfigKeys)
      }
      
      

      Works fine with one configuration key, though.

      The patch is following shortly.

      Attachments

        Issue Links

          Activity

            People

              ivanyu Ivan Yurchenko
              ivanyu Ivan Yurchenko
              Colin McCabe Colin McCabe
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: