Skip to content

KAFKA-10547; add topicId in MetadataResp#9622

Merged
rajinisivaram merged 2 commits intoapache:trunkfrom
dengziming:KAFKA-10547
Dec 18, 2020
Merged

KAFKA-10547; add topicId in MetadataResp#9622
rajinisivaram merged 2 commits intoapache:trunkfrom
dengziming:KAFKA-10547

Conversation

@dengziming
Copy link
Member

@dengziming dengziming commented Nov 19, 2020

More detailed description of your change

  1. Bump the version of MetadataReq and MetadataResp, add topicId in MetadataResp
  2. Alter describeTopic in AdminClientTopicService and ZookeeperTopicService
  3. TopicMetadata is cached in MetadataCache, so we need to add topicId to MetadataCache
  4. MetadataCache is updated by UpdateMetadataRequest, bump the version of UpdateMetadataReq and UpdateMetadataResp, add topicId in UpdateMetadataReq.

Summary of testing strategy (including rationale)

Tested locally, here is some result:

New server + new Client :

kafka-topics.sh --describe --zookeeper localhost:2181 --topic old-version-topic
Topic: old-version-topic TopicId: wRPl6VAlQeyE77bDxEESzg PartitionCount: 2 ReplicationFactor: 1 Configs:
Topic: old-version-topic Partition: 0 Leader: 0 Replicas: 0 Isr: 0
Topic: old-version-topic Partition: 1 Leader: 0 Replicas: 0 Isr: 0

kafka-topics.sh --describe --bootstrap-server localhost:9092 --topic old-version-topic
Topic: old-version-topic TopicId: wRPl6VAlQeyE77bDxEESzg PartitionCount: 2 ReplicationFactor: 1 Configs: segment.bytes=1073741824
Topic: old-version-topic Partition: 0 Leader: 0 Replicas: 0 Isr: 0
Topic: old-version-topic Partition: 1 Leader: 0 Replicas: 0 Isr: 0

Old Server + new Client

kafka-topics.sh --describe --bootstrap-server localhost:9092 --topic old-version-topic
Topic: old-version-topic PartitionCount: 2 ReplicationFactor: 1 Configs: segment.bytes=1073741824
Topic: old-version-topic Partition: 0 Leader: 0 Replicas: 0 Isr: 0
Topic: old-version-topic Partition: 1 Leader: 0 Replicas: 0 Isr: 0

New server + old client

kafka-topics.sh --describe --bootstrap-server localhost:9092 --topic old-version-topic
Topic: old-version-topic PartitionCount: 2 ReplicationFactor: 1 Configs: segment.bytes=1073741824
Topic: old-version-topic Partition: 0 Leader: 0 Replicas: 0 Isr: 0
Topic: old-version-topic Partition: 1 Leader: 0 Replicas: 0 Isr: 0

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

@dengziming
Copy link
Member Author

@rajinisivaram @jolshan Hi, PTAL.

@jolshan
Copy link
Member

jolshan commented Nov 19, 2020

Hi @dengziming! Thanks for the PR! I was hoping to add LeaderAndIsrRequests before UpdateMetadata/Metadata, following the ordering of the JIRA tickets. There are just a few features for persisting the topic IDs I wanted to include. I'm thinking we could review this PR and my PR: #9626 at the same time and merge mine first and yours immediately after.

@jolshan
Copy link
Member

jolshan commented Nov 22, 2020

@dengziming Looks pretty good so far to me! I think it would be useful to write a few unit/integration tests to ensure the metadata snapshot behavior and describe topics work as expected.

@dengziming
Copy link
Member Author

@dengziming Looks pretty good so far to me! I think it would be useful to write a few unit/integration tests to ensure the metadata snapshot behavior and describe topics work as expected.

I added/altered some unit/integration tests in MetadataRequestTest and ControllerChannelManagerTest, take a look.

Copy link
Contributor

@rajinisivaram rajinisivaram left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dengziming Thanks for the PR, looks good. Left some comments.

Copy link
Contributor

@rajinisivaram rajinisivaram left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dengziming Thanks for the updates, looks good, just a couple more comments left.

@dengziming dengziming force-pushed the KAFKA-10547 branch 2 times, most recently from 5e59937 to 680308e Compare December 17, 2020 03:17
Copy link
Contributor

@rajinisivaram rajinisivaram left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dengziming Thanks for the update, just one minor comment left, apart from that LGTM.

KAFKA-10547; alter some integration tests

KAFKA-10547; optimeze imports

resolve comments
Copy link
Contributor

@rajinisivaram rajinisivaram left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dengziming Thanks for the update, LGTM. Will review PR #9626 as well and merge these two together, hopefully later today.

@rajinisivaram
Copy link
Contributor

There is a compilation failure in the Java 8 build because the PR uses an API not available in Scala 2.12. Will push a fix.

@rajinisivaram
Copy link
Contributor

@dengziming Thanks for the PR, merging to trunk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments