Skip to content

Conversation

mimir-github-bot[bot]
Copy link
Contributor

Backport 8c9ffff from #11989

… incorrect results (#11989)

#### What this PR does

This PR fixes an issue where common subexpression elimination (CSE) can
cause a query to return incorrect query results.

The issue would occur if the ring buffer used to buffer data was in a
state where the head of the buffer is at the end of the slice, and the
tail was at the beginning of the slice. In this case, calling `Remove`
for the item at the end of the slice would return the correct value, as
would the subsequent call for the item at the beginning of the slice,
but all following calls would return incorrect values.

#### Which issue(s) this PR fixes or relates to

#11189

#### Checklist

- [x] Tests updated.
- [n/a] Documentation added.
- [covered by #10067] `CHANGELOG.md` updated - the order of entries
should be `[CHANGE]`, `[FEATURE]`, `[ENHANCEMENT]`, `[BUGFIX]`. If
changelog entry is not needed, please add the `changelog-not-needed`
label to the PR.
- [n/a]
[`about-versioning.md`](https://github.com/grafana/mimir/blob/main/docs/sources/mimir/configure/about-versioning.md)
updated with experimental features.

(cherry picked from commit 8c9ffff)
@mimir-github-bot mimir-github-bot bot requested a review from a team as a code owner July 7, 2025 01:15
@mimir-github-bot mimir-github-bot bot requested a review from charleskorn July 7, 2025 01:15
@charleskorn charleskorn enabled auto-merge (squash) July 7, 2025 01:18
@charleskorn charleskorn merged commit ae4a1c5 into r345 Jul 7, 2025
31 checks passed
@charleskorn charleskorn deleted the backport-11989-to-r345 branch July 7, 2025 01:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant