-
-
Notifications
You must be signed in to change notification settings - Fork 191
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
Question: Produce reordering protection #852
Comments
I think the summary is:
This is not preventable currently. To make it preventable, a new feature would need to be added where, one a record on a partition fails, the partition is set to a failed state until you manually recover it. You would then also need to take a lot of care instrumenting your application to:
This would require a new option and a new client method: func FailPartitionOnProduceFailure() ProducerOpt
func (*Client) RecoverFailedProducePartitions() (perhaps better names are possible). Is this what you'd like? (and perhaps, if you want to dig in / implement, let me know) |
Thank your for your reply! Your suggestion sounds reasonable. I think i see three important points here:
Taking it into account i think the solution could be:
Also i have a question about handling "pre-buffering" errors - why you decided to not return error from |
I'm not sure how (2) addresses the reordering protection problem brought up above. I thought the problem is:
My response is about how it is possible to instrument code surrounding kgo library calls such that you can re-produce A and B before C, however it is a hassle. The sync callback option allows you to skip A while preserving B, such that B then C ordering is preserved, even though A is failed. This is starting to sound like you're trying to have a dead letter queue for A, while ordering is preserved for all non-failing records (rather than reproducing A, assuming something went wrong and we can make it successful the second time). Is that your goal here? Note that A, B, and C are actually batches rather than individual records. Entire batches fail at a time. (3) sounds like my proposal above. As far as the final question, |
Hello and thank you for your great work!
Lets say we have a following scenario
So now is the moment to make decision what to do with failed message. If a message has key the producing code expects that records will be sent to kafka in order it appeared.
But if a promise-invoking goroutine will be scheduled with some significant delay, the producing thread can go ahead producing after partition buffer was discarded and before the promises with error were called to stop producing at all(for example).
So if failed/discarded messages and newly pushed messages has the same keys the ordering could be broken.
The same problem may occur if i will try to send 2 messages with the same key but the first one will be too big - in such case the promise will be scheduled and the second message could be produced before the promise for the first one will fire.
I thought there is some option/callback that will stop producing/buffering reliably to prevent reordering but didnt find one
Am i wrong and there is some way to handle such cases? Or maybe such scenarios just not possible at all?
I really think im missing something and will appreciate your help!
The text was updated successfully, but these errors were encountered: