-
Notifications
You must be signed in to change notification settings - Fork 15.2k
KAFKA-4089: KafkaProducer expires batch when metadata is stale #1791
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
Closed
Closed
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
33b8580
KAFKA-4089: fixing batch expired when stale metadata
4ccff43
updated batch expiry conditions
2589bb3
updated conditions for batch expiry
sutambe 2199749
fixing accumulator test
sutambe 68643ff
fixed unit test
sutambe 30048ea
checkstyle fixes
sutambe e64af48
fixing batch expiry
sutambe 7831754
refactored batch expiry logic into Sender
sutambe 304526e
restored KafkaProducer back to upstream/trunk
sutambe 01582a2
refactored batch expiry logic
sutambe 3d7baf5
added explanation for the staleness determination formula
sutambe 1b6eba9
unused import
sutambe 90faa04
updated batch expiry logic documentation
sutambe 1c8572b
clean up comments and documentation
sutambe b4c818e
rebased on upstream/trunk
sutambe 538a90a
updating batch expiry condition to include retries
sutambe 348a341
replaced metadataExpireMs with metadataMaxAgeMs for consistency with …
sutambe a5bfc6a
fixing comments and consolidating static constants
sutambe 4aa79b7
updated retries
sutambe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, is the logic here correct? Let's say there is a network issue and the producer can't talk to any broker. All leaders are not be empty. It will take at least 300 seconds before the metadata becomes stable. Then some of the records will have to sit in the bufferpool much longer than the default 30 second request timeout before being expired. This seems a big change in behavior.
Also, would it be better to consolidate the check here into accumulator.abortExpiredBatches()?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The condition in Sender.java is a quick check to avoid expensive iteration in
abortExpiredBatcheswhen we can. I.e., when metadata is fresh and leaders for all partitions are known there's no reason to drop into the iteration inabortExpiredBatches. We'll not expire any batches in that case.