KAFKA-10774; Support Describe topic using topic IDs#9769
KAFKA-10774; Support Describe topic using topic IDs#9769rajinisivaram merged 10 commits intoapache:trunkfrom
Conversation
clients/src/main/java/org/apache/kafka/common/protocol/Errors.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/clients/admin/DescribeTopicsResult.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/clients/admin/Admin.java
Outdated
Show resolved
Hide resolved
6018b4b to
73a8ea1
Compare
rajinisivaram
left a comment
There was a problem hiding this comment.
@dengziming Thanks for the PR, left some comments. The main thing to watch out for is compatibility of the public API.
clients/src/main/java/org/apache/kafka/clients/admin/DescribeTopicsResult.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/clients/admin/TopicDescription.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/common/requests/MetadataResponse.java
Outdated
Show resolved
Hide resolved
clients/src/test/java/org/apache/kafka/clients/admin/MockAdminClient.java
Outdated
Show resolved
Hide resolved
0e25260 to
5df1f32
Compare
|
@dengziming #9814 has been merged, so this needs rebasing and the check for IBP. Thanks. |
|
@dengziming I realized that for this, it really depends on the IBP of the controller. (That is, we need UpdateMetadata to send topic IDs to all the brokers). So maybe instead of checking IBP it would make sense to check if the MetadataCache does not have any topic IDs. What do you think? |
|
@rajinisivaram @jolshan I also realized this, we add topicId in |
311f488 to
4e20a8d
Compare
|
@rajinisivaram I rebased the code and added a test in |
rajinisivaram
left a comment
There was a problem hiding this comment.
@dengziming Thanks for the updates. Left some comments/questions. I ran one of the tests and there were NullPointerExceptions, so those needs fixing as well.
clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/clients/admin/TopicDescription.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/clients/admin/TopicDescription.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/common/errors/UnknownTopicIdException.java
Outdated
Show resolved
Hide resolved
|
Hello, @rajinisivaram , I resolved the comments/questions and fixed the NullPointerExceptions, call for a third review.
|
rajinisivaram
left a comment
There was a problem hiding this comment.
@dengziming Thanks for the updates and tests, looks good. Left just a couple of minor comments. @jolshan Can you also review to make sure I haven't missed anything? Thanks.
core/src/test/scala/integration/kafka/server/MetadataRequestBetweenDifferentIbpTest.scala
Outdated
Show resolved
Hide resolved
core/src/test/scala/integration/kafka/server/MetadataRequestBetweenDifferentIbpTest.scala
Outdated
Show resolved
Hide resolved
rajinisivaram
left a comment
There was a problem hiding this comment.
@dengziming Thanks for the updates, LGTM. Will merge after @jolshan has a chance to review.
core/src/test/scala/integration/kafka/server/MetadataRequestBetweenDifferentIbpTest.scala
Outdated
Show resolved
Hide resolved
core/src/test/scala/integration/kafka/server/MetadataRequestBetweenDifferentIbpTest.scala
Outdated
Show resolved
Hide resolved
|
Thanks for the updates and all the hard work! I added a few comments. Mostly just questions for clarification. |
There was a problem hiding this comment.
thanks @dengziming for the PR. Oveall LGTM, left minor comments.
clients/src/main/java/org/apache/kafka/clients/admin/TopicListing.java
Outdated
Show resolved
Hide resolved
satishd
left a comment
There was a problem hiding this comment.
thanks @dengziming for addressing the review comments, LGTM.
8da4a39 to
83c3f0d
Compare
|
@rajinisivaram Are you interested in taking this across finish line? I think this has something that is very close to a first version, we can try to land that and then improvise since this has been worked for a long time, thank you! |
|
@dengziming -- @rajinisivaram can help in about 2 weeks. I will try to help review so it will be ready when she gets to it. |
clients/src/main/java/org/apache/kafka/clients/admin/Admin.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/clients/admin/Admin.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/clients/admin/DescribeTopicsResult.java
Outdated
Show resolved
Hide resolved
core/src/test/scala/integration/kafka/server/MetadataRequestBetweenDifferentIbpTest.scala
Outdated
Show resolved
Hide resolved
cedaec4 to
140ade8
Compare
rajinisivaram
left a comment
There was a problem hiding this comment.
@dengziming Thanks for the updates, looks good. Left some minor comments, I think it is ready to go after that.
clients/src/main/java/org/apache/kafka/clients/admin/DescribeTopicsResult.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/clients/admin/DescribeTopicsResult.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/clients/admin/DescribeTopicsResult.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/clients/admin/DescribeTopicsResult.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/clients/admin/DescribeTopicsResult.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/common/requests/MetadataResponse.java
Outdated
Show resolved
Hide resolved
clients/src/main/java/org/apache/kafka/common/requests/MetadataResponse.java
Outdated
Show resolved
Hide resolved
KAFKA-10774; add topicId in TopicCommand Gate topic IDs behind IBP 2.8.1 add ITCase of metadata request edge case between different ipb Add Unauthorized unit test use matchSameElements replace EasyMock.eq since the order of the request is unknown resolve conflicts check KAFKA-12394 check KAFKA-12701
140ade8 to
d0bc3cd
Compare
rajinisivaram
left a comment
There was a problem hiding this comment.
@dengziming Thanks for the updates, LGTM. Sorry about the delay in getting this in and thanks for your patience! Merging to trunk.
Reviewers: Justine Olshan <jolshan@confluent.io>, Chia-Ping Tsai <chia7712@gmail.com>, Satish Duggana <satishd@apache.org>, Rajini Sivaram <rajinisivaram@googlemail.com>
… the deprecated `all` API ### What changes were proposed in this pull request? This PR aims to use `DescribeTopicsResult.allTopicNames` API instead of the deprecated `all` API. ### Why are the changes needed? `all` API was deprecated at Apache Kafka 3.1.0 and removed at 4.0.0. - apache/kafka#9769 - apache/kafka#18255 > The <code>all()</code> method was removed from the <code>org.apache.kafka.clients.admin.DescribeTopicsResult</code>. Please use <code>allTopicNames()</code> instead. ### Does this PR introduce _any_ user-facing change? No behavior change. ### How was this patch tested? Pass the CIs. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #52597 from dongjoon-hyun/DescribeTopicsResult. Authored-by: Dongjoon Hyun <dongjoon@apache.org> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
… the deprecated `all` API ### What changes were proposed in this pull request? This PR aims to use `DescribeTopicsResult.allTopicNames` API instead of the deprecated `all` API. ### Why are the changes needed? `all` API was deprecated at Apache Kafka 3.1.0 and removed at 4.0.0. - apache/kafka#9769 - apache/kafka#18255 > The <code>all()</code> method was removed from the <code>org.apache.kafka.clients.admin.DescribeTopicsResult</code>. Please use <code>allTopicNames()</code> instead. ### Does this PR introduce _any_ user-facing change? No behavior change. ### How was this patch tested? Pass the CIs. ### Was this patch authored or co-authored using generative AI tooling? No. Closes apache#52597 from dongjoon-hyun/DescribeTopicsResult. Authored-by: Dongjoon Hyun <dongjoon@apache.org> Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
More detailed description of your change
MetadataCacheand alterKafkaApis.handleTopicMetadataRequestaccording to the KIPdescribeTopics(TopicCollection)in KafkaAdminClient, similar todescribeTopicsDescribeTopicsResultto support TopicIdSummary of testing strategy (including rationale)
Test locally, here is some result:
New server + new Client
Old Server + new Client
New server + old client
Committer Checklist (excluded from commit message)