KENGINE-283 Topic ID Mismatch Issue - Exception added to disallow Alt…#851
Merged
Merged
Conversation
…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
Ritika Reddy (rreddy-22)
requested review from
YiDing-Duke and
Justine Olshan (jolshan)
December 16, 2022 23:57
|
|
||
| import kafka.admin.TopicCommand.{TopicCommandOptions, ZookeeperTopicService} | ||
| import kafka.common.AddPartitionNotAllowedDueToTopicIDMismatchException | ||
|
|
There was a problem hiding this comment.
small nit: new line here.
Justine Olshan (jolshan)
approved these changes
Dec 20, 2022
Justine Olshan (jolshan)
left a comment
Member
There was a problem hiding this comment.
looks good. Left a small nit.
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.
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