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: prevent idempotent producer epoch exhaustion #2178

Merged
merged 1 commit into from
Apr 13, 2022

Conversation

ladislavmacoun
Copy link
Contributor

Add check for idempotent producer epoch overflow, as it is required by the
KIP-360, the producer should request a new producer ID when the epoch
is exhausted. Otherwise, the producer might get desynchronized with the
broker.

AK producer for reference

Similar issue to confluentinc/librdkafka#3720

@ghost ghost added the cla-needed label Mar 14, 2022
@ladislavmacoun ladislavmacoun force-pushed the fix-exhausted-epochs branch 2 times, most recently from 0e48f14 to 41494f2 Compare March 15, 2022 09:11
@ghost ghost removed the cla-needed label Mar 15, 2022
@ladislavmacoun ladislavmacoun force-pushed the fix-exhausted-epochs branch 2 times, most recently from 86c8dc0 to b472f28 Compare March 16, 2022 11:01
Comment on lines +1135 to +1146
if err != nil {
Logger.Println(err)
return
Copy link
Collaborator

Choose a reason for hiding this comment

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

In this case, where we failed to send our InitProducerIDRequest to any broker and got ErrOutOfBrokers returned, do we need to do something more serious than just logging the error? Or are we happy just to leave p.txnmgr as the existing transaction manager with epoch left at MaxInt16 and we think the producer will eventually recover itself?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@ladislavmacoun I'm assuming the latter?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dnwe Apologies for the late reply.

Looking at the Java AK client, the producer only transitions to an uninitialized state, I believe we will achieve the same thing with resetting the transitional manager. If it fails I don't think there is anything else we can do, and it should get initialised with another request eventually.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@ladislavmacoun no worries, thanks for your great contribution!

Add check for idempotent producer epoch overflow, as it is required by the
KIP-360[1], the producer should request a new producer ID when the epoch
is exhausted. Otherwise, the producer might get desynchronized with the broker.

[1]: https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=89068820

Signed-off-by: Ladislav Macoun <ladislavmacoun@gmail.com>
@dnwe dnwe changed the title Fix exhausted epochs fix: prevent idempotent producer epoch exhaustion Apr 13, 2022
@dnwe dnwe added the fix label Apr 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants