-
Notifications
You must be signed in to change notification settings - Fork 25k
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 ByteArrayIndexInput with nonzero offset #93205
Fix ByteArrayIndexInput with nonzero offset #93205
Conversation
We introduced a bug in elastic#79885 by not accounting for cases where there's a nonzero offset in the underlying byte array. Unfortunately `ESIndexInputTestCase` didn't cover these code paths. This commit extends the test coverage and fixes the bug.
Hi @DaveCTurner, I've created a changelog YAML for you. |
Pinging @elastic/es-distributed (Team:Distributed) |
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
Thanks @DaveCTurner!
We introduced a bug in elastic#79885 by not accounting for cases where there's a nonzero offset in the underlying byte array. Unfortunately `ESIndexInputTestCase` didn't cover these code paths. This commit extends the test coverage and fixes the bug.
💚 Backport successful
|
We introduced a bug in #79885 by not accounting for cases where there's a nonzero offset in the underlying byte array. Unfortunately `ESIndexInputTestCase` didn't cover these code paths. This commit extends the test coverage and fixes the bug.
// Read by one byte at a time | ||
output[readPos++] = indexInput.readByte(); | ||
final var readStrategy = randomFrom(2, 6); | ||
switch (readStrategy) { |
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.
Above looks suspicious. Should it be randomIntBetween(0, 9)
?
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.
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.
and #93227 fixes this in 8.6 too
In elastic#93205 we fixed a bug in `ByteArrayIndexInput` but accidentally reduced the coverage of the test suite with a supposedly-temporary change for debugging purposes. This commit brings the test suite back up to full strength again. This was fixed in `main` by elastic#93208, but most of that change is not for backporting.
In #93205 we fixed a bug in `ByteArrayIndexInput` but accidentally reduced the coverage of the test suite with a supposedly-temporary change for debugging purposes. This commit brings the test suite back up to full strength again. This was fixed in `main` by #93208, but most of that change is not for backporting.
We introduced a bug in #79885 by not accounting for cases where there's a nonzero offset in the underlying byte array. Unfortunately
ESIndexInputTestCase
didn't cover these code paths. This commit extends the test coverage and fixes the bug.