PQ: avoid blocking writer when precisely full #16176
Merged
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.
Release notes
Fixes an issue in which an input writing to a PQ could become blocked indefinitely after writing an event that precisely fit the remaining capacity of a PQ configured to handle a single PQ-page of events.
What does this PR do?
A PQ is considered full (and therefore needs to block before releasing the
writer) when its persisted size on disk exceeds its
queue.max_bytes
capacity.
This removes an edge-case preemptive block when the persisted size after
writing an event meets its
queue.max_bytes
precisely AND its currenthead page has insufficient room to also accept a hypothetical future event.
A block formed in this way would only be broken the next time a tail page
is fully-acked, which cannot occur when the
queue.max_bytes
is configuredto match
queue.page_capacity
.Why is it important/What is the impact to the user?
Users who configure their
queue.max_bytes
to matchqueue.page_capacity
do so to eliminate buffering, and this fix eliminates an edge-case that could cause their PQ to block indefinitely.Checklist
[ ] I have made corresponding change to the default configuration files (and/or docker env variables)How to test this PR locally
See: #16172
Related issues
Fixes: #16172