Skip to content

KENGINE-283 Topic ID Mismatch Issue - Exception added to disallow Alt…#851

Merged
Ritika Reddy (rreddy-22) merged 1 commit into
2.5from
KENGINE-283-2.5/rreddy-22
Dec 20, 2022
Merged

KENGINE-283 Topic ID Mismatch Issue - Exception added to disallow Alt…#851
Ritika Reddy (rreddy-22) merged 1 commit into
2.5from
KENGINE-283-2.5/rreddy-22

Conversation

@rreddy-22

Copy link
Copy Markdown

This PR is related to the following JIRA tickets:-
https://confluentinc.atlassian.net/browse/KENGINE-283
https://confluentinc.atlassian.net/browse/SUP-61

Issue Statement:-
Topic ID mismatch issues occur when older zk clients are used with newer versions of the controller.
When the client is using ce-kafka/Confluent Platform versions 5.4.x, 5.5.x, 6.0.x, 6.1.x with Controller of version 6.2.x with IBP 2.8+ (when usesLegacyTopicId = false and usesModernTopicId = true) the topic_id will be written into the TopicZnode. This happens due to the absence of a topicID when the topic was created. The decode in these older versions that is called after the alterTopic method is invoked isn’t equipped to read topicID(topic_id) and hence overwrites the entire TopicZnode with an empty topicID field.

Reference for versions:- https://docs.confluent.io/platform/current/installation/versions-interoperability.html#supported-versions-and-interoperability-for-cp

Solution:-

CP versions 5.4.x ,5.5.x, 6.0.x and 6.1.x need a mechanism in place to prevent the Alter Topic (Add Partitions) command from executing when used with the Zookeeper flag in order to prevent overwriting the topicId that was created and assigned by the controller running a newer version.
An exception (AddPartitionNotAllowedDueToTopicIDMismatchException) will be thrown when the topicID field is found on decoding the topics replica assignment

…er Topic with Zookeeper Flag (#844)

* KENGINE-283 Topic ID Mismatch Issue - Exception added to disallow Alt… (apache#8142)

* KENGINE-283 Topic ID Mismatch Issue - Exception added to disallow Alter Topic with Zookeeper Flag

* Addressed PR Comments and added a check to see if TopicID still exists after the command is stopped

* Addressed PR Comments and added a check to see if TopicID still exists after the command is stopped

* Changed exception message

* Changed exception message

* Changed exception message

* Don't need assignment

* Nit change

import kafka.admin.TopicCommand.{TopicCommandOptions, ZookeeperTopicService}
import kafka.common.AddPartitionNotAllowedDueToTopicIDMismatchException

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

small nit: new line here.

@jolshan Justine Olshan (jolshan) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

looks good. Left a small nit.

@rreddy-22
Ritika Reddy (rreddy-22) deleted the KENGINE-283-2.5/rreddy-22 branch December 20, 2022 18:05
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.

2 participants