-
Notifications
You must be signed in to change notification settings - Fork 454
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 panic introduced by OStream optimization #1437
Conversation
85f11c9
to
794654c
Compare
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.
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
1c73278
to
f2eb6d1
Compare
Codecov Report
@@ Coverage Diff @@
## master #1437 +/- ##
========================================
+ Coverage 70.9% 70.9% +<.1%
========================================
Files 836 836
Lines 71507 71507
========================================
+ Hits 50706 50714 +8
+ Misses 17507 17497 -10
- Partials 3294 3296 +2
Continue to review full report at Codecov.
|
A panic was introduced by #1399 that can occur when many reads are happening in parallel for the same series. The panic occurs because the previous P.R introduced a called to
Reset()
on achecked.Bytes
on the read path.The read path is only protected by an RLock so this would be interpreted by the checked.Bytes as a double write and cause a panic. Technically no double write was taking place because the second called to
Reset
would be a no-op, but the checked.Bytes has no way to distinguish that and we shouldn't be doing any mutation on the read path anyways.This P.R updates the code path so that the call to
RawBytes
actually just returns[]byte
instead ofchecked.Bytes
. This avoids the issue of performing a mutation on the read path entirely.I've also included a regression test which would have caught the issue.