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

MetadataCache.getPartitionMetadata may return incorrect error code when partition's leader is not present at the MetadataCache

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 2.7.0
    • core
    • None

    Description

      `MetadataCache.getPartitionMetadata` returns an error code if the partition's leader is not present at the MetadataCache, or if the Listener endpoint is not present for the leader. Newer versions for metadata returns LEADER_NOT_AVAILABLE and LISTENER_NOT_FOUND for the above two cases respectively.

       There is a small bug in this logic. Current code checks the MetadataCache's host broker Id instead of the partition's leader id (in the list of alive brokers) when determining what error code to return. This may result in this call returning LISTENER_NOT_FOUND error code even when partition's leader is not present at MetadataCache and it should have returned LEADER_NOT_AVAILABLE.

      Attachments

        Issue Links

          Activity

            People

              ramanverma Raman Verma
              ramanverma Raman Verma
              Jason Gustafson Jason Gustafson
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: