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
- links to