-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Fix RecyclerBytesStreamOutput corrupting when ending write on page boundary #95114
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
Fix RecyclerBytesStreamOutput corrupting when ending write on page boundary #95114
Conversation
…undary Fixes the fact that we don't put the current page offset to zero when we already have capacity in the buffer but are not on the last page because of a seek.
Hi @original-brownbear, I've created a changelog YAML for you. |
Pinging @elastic/es-distributed (Team:Distributed) |
currentCapacity += pageSize; | ||
} | ||
if (currentPageOffset == pageSize) { |
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.
This is also faster for the rare case where we have to allocate multiple pages in a loop to make space here.
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.
LGTM but would this have been caught by an existing test (maybe testSeek
) eventually? If not I think we need some more evil randomised tests in this area.
Thanks David!
Incoming today, I found another bug with this thing I believe and will add some more testing to that PR. |
…undary (elastic#95114) Fixes the fact that we don't put the current page offset to zero when we already have capacity in the buffer but are not on the last page because of a seek.
* [DOCS] Forward port 8.7.1 release notes * Add known issue docs for #95114 (#96448) --------- Co-authored-by: David Turner <[email protected]>
The recycled buffer issued was fixed in elastic#95114, so we can unmute the test See elastic#95096
The recycled buffer issued was fixed in #95114, so we can unmute the test
Fixes the fact that we don't put the current page offset to zero when we already have capacity in the buffer but are not on the last page because of a seek.
Also removes unused
reset()
method since it added one needless place for me to check when trying to reason this out.