KAFKA-7808: AdminClient#describeTopics should not throw InvalidTopicException if topic name is not found#6124
Merged
cmccabe merged 1 commit intoapache:trunkfrom Jan 11, 2019
Conversation
…if topic name is not found Currently, AdminClient#describeTopics is called in WorkerUtils#[getMatchingTopicPartitions,verifyTopics] only. However, WorkerUtils#getMatchingTopicPartitions does not being called - So it should be removed. 1. Update KafkaAdminClient#describeTopics to throw UnknownTopicOrPartitionException. 2. Change the Exception message thrown by MockAdminClient#describeTopics: for consistency with KafkaAdminClient. 3. Remove unused method: WorkerUtils#getMatchingTopicPartitions. 4. Add @throws description on WorkerUtils#verifyTopics: when UnknownTopicOrPartitionException is thrown. 5. Expand Javadoc on WorkerUtils#createTopics(Logger, AdminClient, Map, boolean): the only method which calles WorkerUtils#verifyTopics. Since the Throwable instance thrown by WorkerUtils#createTopics(Logger, AdminClient, Map, boolean) is catched by [ProduceBenchWorker,RoundTripWorker].Prepare, we don't need more cleanup.
ryannedolan
reviewed
Jan 11, 2019
Contributor
|
Throwing |
Member
|
We should add a note to the upgrade notes probably. |
Member
Contributor
|
LGTM! Thanks. |
Contributor
|
@ijuma Should this be cherry-picked to older branches? |
Member
|
I think it's safest to only do it in trunk since it's a slight change in behaviour even if it's a bug fix. We should have an upgrade note too. |
This was referenced Jan 18, 2019
jimjag
pushed a commit
to jimjag/kafka
that referenced
this pull request
Jan 18, 2019
…ger (apache#6167) Note we can only remove this handling in 2.2 but not in 2.1 since apache#6124 is only in 2.2. Reviewers: Bill Bejeck <bill@confluent.io>, Damian Guy <damian@confluent.io>, Matthias J. Sax <matthias@confluent.io>
abbccdda
pushed a commit
to abbccdda/kafka
that referenced
this pull request
Jan 24, 2019
…ger (apache#6167) Note we can only remove this handling in 2.2 but not in 2.1 since apache#6124 is only in 2.2. Reviewers: Bill Bejeck <bill@confluent.io>, Damian Guy <damian@confluent.io>, Matthias J. Sax <matthias@confluent.io>
pengxiaolong
pushed a commit
to pengxiaolong/kafka
that referenced
this pull request
Jun 14, 2019
…if topic name is not found (apache#6124) * Update KafkaAdminClient#describeTopics to throw UnknownTopicOrPartitionException. * Remove unused method: WorkerUtils#getMatchingTopicPartitions. * Add some JavaDoc. Reviewed-by: Colin P. McCabe <cmccabe@apache.org>, Ryanne Dolan <ryannedolan@gmail.com>
pengxiaolong
pushed a commit
to pengxiaolong/kafka
that referenced
this pull request
Jun 14, 2019
…ger (apache#6167) Note we can only remove this handling in 2.2 but not in 2.1 since apache#6124 is only in 2.2. Reviewers: Bill Bejeck <bill@confluent.io>, Damian Guy <damian@confluent.io>, Matthias J. Sax <matthias@confluent.io>
3 tasks
jolshan
pushed a commit
that referenced
this pull request
Jan 4, 2024
… ID (#14599) Throw UnknownTopicIdException instead of InvalidTopicException when no name is found for the topic ID. Similar to #6124 for describeTopics using a topic name. MockAdminClient already makes use of UnknownTopicIdException for this case. Reviewers: Justine Olshan <jolshan@confluent.io>, Ashwin Pankaj <apankaj@confluent.io>
yyu1993
pushed a commit
to yyu1993/kafka
that referenced
this pull request
Feb 15, 2024
… ID (apache#14599) Throw UnknownTopicIdException instead of InvalidTopicException when no name is found for the topic ID. Similar to apache#6124 for describeTopics using a topic name. MockAdminClient already makes use of UnknownTopicIdException for this case. Reviewers: Justine Olshan <jolshan@confluent.io>, Ashwin Pankaj <apankaj@confluent.io>
AnatolyPopov
pushed a commit
to aiven/kafka
that referenced
this pull request
Feb 16, 2024
… ID (apache#14599) Throw UnknownTopicIdException instead of InvalidTopicException when no name is found for the topic ID. Similar to apache#6124 for describeTopics using a topic name. MockAdminClient already makes use of UnknownTopicIdException for this case. Reviewers: Justine Olshan <jolshan@confluent.io>, Ashwin Pankaj <apankaj@confluent.io>
clolov
pushed a commit
to clolov/kafka
that referenced
this pull request
Apr 5, 2024
… ID (apache#14599) Throw UnknownTopicIdException instead of InvalidTopicException when no name is found for the topic ID. Similar to apache#6124 for describeTopics using a topic name. MockAdminClient already makes use of UnknownTopicIdException for this case. Reviewers: Justine Olshan <jolshan@confluent.io>, Ashwin Pankaj <apankaj@confluent.io>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently,
AdminClient#describeTopicsis called inWorkerUtils#[getMatchingTopicPartitions,verifyTopics]only. However,WorkerUtils#getMatchingTopicPartitionsdoes not being called by anyone - so it should be removed.KafkaAdminClient#describeTopicsto throwUnknownTopicOrPartitionException.MockAdminClient#describeTopics: for consistency withKafkaAdminClient.WorkerUtils#getMatchingTopicPartitions.WorkerUtils#verifyTopics: whenUnknownTopicOrPartitionExceptionis thrown.WorkerUtils#createTopics(Logger, AdminClient, Map, boolean): the only method which callsWorkerUtils#verifyTopics.Since the
Throwableinstance thrown byWorkerUtils#createTopics(Logger, AdminClient, Map, boolean)is caught by[ProduceBenchWorker,RoundTripWorker].Prepare, we don't need more cleanup.Committer Checklist (excluded from commit message)