-
Notifications
You must be signed in to change notification settings - Fork 122
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
fix e2e producer #268
fix e2e producer #268
Conversation
if err != nil { | ||
return fmt.Errorf("could not get topic metadata after validation: %w", err) | ||
} | ||
partitions := len(topicMetadata.Topics[0].Partitions) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
even if the err
above is nil the topicMetadata.Topics[0].ErrorCode
is not guaranteed to be zero.
Hi @weeco. Can you please have a look? |
@bachmanity1 I'll try to look at your PR soon, but I'm currently very busy with other things that have higher priority. Even though this change is just a few lines, I'll have to dig deeper to see if this could cause other sort of issues before approving & merging the PR. |
Hi @weeco, I wanted to let you know that I've updated this PR. I've realized that my previous approach didn't account for scenarios where the broker count is updated. I also wanted to discuss the By the way, it seems there’s a bug preventing new partitions from being created when new brokers are added, as reported in #257. Could you take a look at that PR too? Thanks! |
Hi @weeco, is there any chance to get this reviewed anytime soon? |
Thanks for your PR @bachmanity1 and sorry for the long waiting time. I added some minor things but generally LGTM |
I've noticed that when working with clusters having several controller and broker nodes, retrieving cluster metadata may occasionally return stale data. This issue is evident when, for example, an end-to-end test topic is created, and the topic metadata is retrieved immediately afterward. In this case, the metadata request may return error code 3, which corresponds to the
UNKNOWN_TOPIC_OR_PARTITION
error. This error likely occurs when a client connects to a broker that is not yet aware of the new topic because it hasn't consumed the latest data from the__cluster_metadata
topic.In summary, when the end-to-end code attempts to populate the value of
s.partitionCount
, it might encounter theUNKNOWN_TOPIC_OR_PARTITION
error, even if the topic actually exists. This results in a partition count of zero, preventing the producer from sending any data.