-
Notifications
You must be signed in to change notification settings - Fork 14.8k
KAFKA-19519: Introduce group.coordinator.append.max.buffer.size config #20847
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
Open
DL1231
wants to merge
7
commits into
apache:trunk
Choose a base branch
from
DL1231:KAFKA-19519-0
base: trunk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+334
−73
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
3a754c3
KAFKA-19519: Introduce group.coordinator.append.max.buffer.size config
DL1231 42bb58d
Merge remote-tracking branch 'origin/trunk' into KAFKA-19519-0
DL1231 d11c7ea
add metrics
DL1231 83db7aa
fix config default value
DL1231 99a23cb
address comment
DL1231 3f21612
fix comment
DL1231 8d293a5
Merge remote-tracking branch 'origin/trunk' into KAFKA-19519-0
DL1231 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.
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.
The size implementations aren't thread safe, but they will be called from a metrics thread.
Uh oh!
There was an error while loading. Please reload this page.
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.
Thank you for pointing out this issue. As
BufferSupplieris designed to be a "simple non-threadsafe interface for caching byte buffers," I've made the following targeted changes to address the specific concerns with thesize()method when called from metrics threads:bufferMapinDefaultSupplierto aConcurrentHashMapto prevent potentialConcurrentModificationException.volatilekeyword tocachedBufferinGrowableBufferSupplierto resolve visibility issues.I intentionally avoided adding synchronization to the
get(),release(), andsize()methods to maintain performance, as comprehensive thread safety isn't a design goal for this interface. These changes specifically address the metrics collection use case while preserving the lightweight. WDYT?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.
Thanks for updating the PR!
Avoiding locks is the right thing to do but the fixes do not look complete.
ArrayDeques withinDefaultSuppliersuffer from the same visibility issue ascachedBuffer.cachedBufferwithinGrowableBufferSupplier.sizecan be non-nullwhile the second read can benull.Instead I would propose we introduce a size
AtomicLongand update them ingetandrelease.