This repository has been archived by the owner on Jan 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Return a correct metadata response when topic is not found (#1801)
### Motivation https://github.com/apache/kafka/blob/61530d68ce83467de6190a52da37b3c0af84f0ef/core/src/main/scala/kafka/server/KafkaApis.scala#L1203-L1210 When a topic is not found, Kafka only returns `INVALID_TOPIC_EXCEPTION` when the topic name is invalid. If the topic name is valid, `UNKNOWN_TOPIC_OR_PARTITION` will be returned. ### Modifications - Refactor `getPartitionedTopicMetadataAsync` to return the correct error code (and rename this method). For the case when any error happens at the broker side, return `UNKNOWN_TOPIC_OR_PARTITION`. - Do not print error logs when the topic is not found. Kafka also does not print the logs. The Kafka client will print the logs for `UNKNOWN_TOPIC_OR_PARTITION`. - Add `testTopicMetadataNotFound` to verify the changes.
- Loading branch information
1 parent
f0eda8e
commit 4c22dfa
Showing
3 changed files
with
86 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters