Skip to content
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 race condition in Ring.ShuffleShardWithLookback() #295

Merged
merged 4 commits into from
May 11, 2023

Conversation

pracucci
Copy link
Contributor

@pracucci pracucci commented May 11, 2023

What this PR does:
This PR fix race condition in Ring.getCachedShuffledSubringWithLookback(), specifically the access to r.shuffledSubringWithLookbackCache which was not protected by r.mtx.

Which issue(s) this PR fixes:

N/A

Checklist

  • Tests updated
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

Signed-off-by: Marco Pracucci <marco@pracucci.com>
ring/ring.go Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
Signed-off-by: Marco Pracucci <marco@pracucci.com>
Signed-off-by: Marco Pracucci <marco@pracucci.com>
Signed-off-by: Marco Pracucci <marco@pracucci.com>
@pracucci pracucci merged commit 2351b73 into main May 11, 2023
3 checks passed
@pracucci pracucci deleted the fix-shuffle-shard-lookback-race branch May 11, 2023 14:46
@pracucci pracucci mentioned this pull request May 11, 2023
3 tasks
charleskorn added a commit to grafana/mimir that referenced this pull request May 15, 2023
charleskorn added a commit to grafana/mimir that referenced this pull request May 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants