-
-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is a redux of the guts of a producer, with a focus on much more rigor around sequence numbers, particularly around when if ever is it safe to reset them. The version before this did not reset sequence numbers properly: if sequence numbers were reset in the idempotent producer, we did not bump the epoch, so we would get OOOSN. Previously, AbortBufferedRecords did not work at all. The new code avoids failing batches and their corresponding partitions more often now, preferring instead to retry batches. Further, to be absolutely sure we get sequence numbers correct, we now require unlimited retries and no record timeouts for idempotent (and by proxy, transactional) production. --- This refactors most of the accounting aspects of buffering records to be more easily understood and to break up large functions that did too much. I believe this makes some areas clearer now. --- This adds support for the upcoming flexible versions aspect of producing in Kafka 2.8.0+. --- This refactors the leader / leaderEpoch aspects of metadata updates to be simpler and more easily understandable, which removes the need for two large doc comments on recBuf and on cursor. The leader and leaderEpoch are not currently used on recBuf, but we are now prepared for when they will be. --- This adds aborting buffered records when ending a transaction, which previously did not work because AbortBufferedRecords broke sequence numbers. Now, we reset the producer ID, which should be safe and has been integration tested.
- Loading branch information
Showing
13 changed files
with
913 additions
and
831 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.