distributor: fix pool buffer reuse logic when distributor.max-request-pool-buffer-size
is set
#9666
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.
What this PR does
This PR adapts the distributor code to remove the bucketed pool implementation in
util.RequestBuffers
when a maximum pool buffer size is defined.Instead, the code for the default
util.bufferPool
type has been adapted to allow defining a maximum pool capacity.The reason is that with the current implementatiom, bucketed buffers are used to decompress the incoming request acquiring the buffer based on the specified request size. However, since these buffers eventually end up being resized during the decompression process, they can later end up in a different bucket when returned to the pool, thus preventing subsequent reuse and leading to higher GC pressure.
This behavior has been observed in our dev environments when enabling the config parameter
-distributor.max-request-pool-buffer-size
.Which issue(s) this PR fixes or relates to
Fixes n/a
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]
.about-versioning.md
updated with experimental features.