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

Fix: Avoid unnecessary producer epoch bumps #4972

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

marcin-krystianc
Copy link

Fixes: #4953

When the producer is idempotent and max.in.flight.requests.per.connection is set to a value between 2 and 5, it's normal to receive OUT_OF_ORDER_SEQUENCE_NUMBER produce responses for requests R2 through R5 when the R1 failed for any other reason.

Bumping the producer epoch in this scenario violates the "exactly-once" guarantees. Therefore, we believe that it's unnecessary to bump the producer's epoch; re-enqueuing the messages is sufficient.

The same "retry, but don't bump producer epoch" behavior is implemented in the Java client: https://github.com/apache/kafka/blob/a6a588fbed9982598377060c63f94ee6184b4295/clients/src/main/java/org/apache/kafka/clients/producer/internals/TransactionManager.java#L1015-L1016

@marcin-krystianc marcin-krystianc requested a review from a team as a code owner February 19, 2025 12:25
@confluent-cla-assistant
Copy link

🎉 All Contributor License Agreements have been signed. Ready to merge.
✅ marcin-krystianc
Please push an empty commit if you would like to re-run the checks to verify CLA status for all contributors.

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.

Sporadic message duplication during leader transition with idempotent producer
1 participant