Skip to content

KAFKA-10869: Gate topic IDs behind IBP 2.8#9814

Merged
rajinisivaram merged 7 commits intoapache:trunkfrom
jolshan:KAFKA-10869
Jan 20, 2021
Merged

KAFKA-10869: Gate topic IDs behind IBP 2.8#9814
rajinisivaram merged 7 commits intoapache:trunkfrom
jolshan:KAFKA-10869

Conversation

@jolshan
Copy link
Member

@jolshan jolshan commented Jan 2, 2021

Topics processed by the controller and topics newly created will only be given topic IDs if the inter-broker protocol version on the controller is greater than 2.8. This PR also adds a kafka config to specify whether the IBP is greater or equal to 2.8. System tests have been modified to include topic ID checks for upgrade/downgrade tests.

This PR also adds a new integration test file for requests/responses that are not gated by IBP (ex: metadata) This file can be expanded to check topic IDs are handled correctly when the request/response version uses topic IDs but the brokers are not able to handle them.

Committer Checklist (excluded from commit message)

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


private def writeTopicPartitionAssignment(topic: String, replicaAssignment: Map[Int, ReplicaAssignment], isUpdate: Boolean): Unit = {
private def writeTopicPartitionAssignment(topic: String, replicaAssignment: Map[Int, ReplicaAssignment],
isUpdate: Boolean, usesTopicId: Boolean = false): Unit = {
Copy link
Member

Choose a reason for hiding this comment

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

Why do you set the default value to false? I don't think we should give it a default value since the caller can decide it by caller.

Copy link
Member Author

Choose a reason for hiding this comment

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

Some places that eventually call this do not have access to IBP. The controller will eventually pick up and assign topic IDs that need them.

partitionReplicaAssignment: Map[Int, Seq[Int]],
validate: Boolean = true): Unit = {
validate: Boolean = true,
usesTopicId: Boolean = false): Unit = {
Copy link
Member

Choose a reason for hiding this comment

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

So if we use TopicCommand with ZookeeperTopicService to create a topic, we will always not set a topicId?

Copy link
Member Author

@jolshan jolshan Jan 10, 2021

Choose a reason for hiding this comment

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

Initially yes. The controller will process and add topic IDs to these topics if IBP is at least 2.8 in processTopicChange() using the processTopicIds method.

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.

@jolshan Thanks for the PR, looks good. Left some minor 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.

@jolshan Thanks for the updates, LGTM. Can you confirm that the upgrade and downgrade system tests passed with the PR before I merge?

@rajinisivaram
Copy link
Contributor

@jolshan Thanks for running the system tests, merging to trunk.

@rajinisivaram rajinisivaram merged commit 86b9fde into apache:trunk Jan 20, 2021
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.

4 participants

Comments