frankvicky commented on PR #23663: URL: https://github.com/apache/kafka/pull/23663#issuecomment-6147846413
Thanks, I think returning `DUPLICATE_SEQUENCE_NUMBER` from the broker is a good idea, and I have thought it when this ticket was picked up. I consider it as complementary to this PR rather than a replacement. - It changes the error code the broker returns for an existing situation, so it would need a KIP. - The broker used to throw `DuplicateSequenceException` and KAFKA-6683 removed it because the sequence overflow handling was incorrect. A new version has to compare sequences in a wraparound-safe way. - A batch completed through that path has no offset or timestamp (-1). With the client-side bound in this PR the retried batch stays inside the broker's window, so the broker finds it in the cache and returns the real offset. And most important, this PR needs no protocol change and works against existing brokers immediately. What the broker-side change buys us is that producers without this fix also stop failing, and that the partition no longer has to wait for the stuck batch during a failover. I would like to land the client-side fix here and file a follow-up for the broker-side change. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
