-
Notifications
You must be signed in to change notification settings - Fork 544
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
Mimir query engine: fix issue where rate()
over native histograms could panic or return incorrect results
#8850
Conversation
9019dd4
to
1c845c3
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.
Just wondering about the practical consequences of removing the Reset
calls.
@@ -161,7 +161,6 @@ func (b *FPointRingBuffer) Reset() { | |||
|
|||
// Close releases any resources associated with this buffer. | |||
func (b *FPointRingBuffer) Close() { | |||
b.Reset() |
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.
Why is the Reset
call unnecessary? Which practical consequences does removing it have?
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.
Calling Reset
is unnecessary because a FPointRingBuffer
isn't expected to be used after Close
is called.
Co-authored-by: Arve Knudsen <[email protected]>
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
What this PR does
This PR fixes an issue where multiple queries running
rate()
over native histograms simultaneously could panic or return incorrect results.This could happen when multiple queries reused the same
FloatHistogram
instance due to a bug inHPointRingBuffer
.HPointRingBuffer
could retain a reference toFloatHistogram
s while also returning a slice containing thoseFloatHistogram
s to the pool, so a second query could modify thoseFloatHistogram
s concurrently with the original query.Note to reviewers: I've tried to build up this PR incrementally. I'd suggest reviewing each commit individually.
Which issue(s) this PR fixes or relates to
(none)
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]
.about-versioning.md
updated with experimental features.