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
Why not refresh metadata when got ErrNotLeaderForPartition #2760
Comments
@ForeverSRC thanks for raising, a good question! Refreshing metadata in the producer retry case was brought in as part of the Idempotent producer changes, but it's not clear that this refresh needs to be gated for idempotent-only retries |
@ForeverSRC having updated my memory of this after re-reading the code, any retriabe error for a given broker producer should cause it to 'abandon' the broker, do a metadata refresh on the assumption it needs use a different broker producer because the topicpartition has moved: Lines 710 to 724 in 5f63a84
You'd see this in sarama logger output as (e.g.,): |
In my use case we got three |
We got some
ErrNotLeaderForPartition
error after retrying for 3 times, I wonder why the producer doesn't refresh metadata when got that error.sarama/async_producer.go
Lines 1121 to 1126 in d9abf3c
The text was updated successfully, but these errors were encountered: