Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create topic instead of panic, when error is UnknownTopicOrPartition #129

Merged
merged 2 commits into from
Nov 3, 2021
Merged

Create topic instead of panic, when error is UnknownTopicOrPartition #129

merged 2 commits into from
Nov 3, 2021

Conversation

Scandiravian
Copy link
Contributor

Error code 3 corresponds to UnknownTopicOrPartition, which happens when the topic does not exists (https://kafka.apache.org/11/javadoc/org/apache/kafka/common/errors/UnknownTopicOrPartitionException.html).

The validateManagementTopic should create the topic if this error is returned as it will otherwise only be able to initialise if the topic already exists.

Copy link
Contributor

@weeco weeco left a comment

Choose a reason for hiding this comment

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

LGTM,
as soon as we know whether it's safe to assume that len(meta.Topics) is always equal to the number of requested topics we can further simplify that function! From the comments in franz-go code it looks like it is safe to assume indeed.

@weeco weeco merged commit 9960755 into redpanda-data:master Nov 3, 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.

2 participants