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

sort ingesters when generating token lookup table fix #6513 #6535

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dsabsay
Copy link
Contributor

@dsabsay dsabsay commented Jan 22, 2025

What this PR does:

Sort ingesters when generating token lookup table in ring to fix consistency issues.

Since map iteration order is undefined, successive calls to getTokensInfo() can return different results when tokens are owned by multiple instances in the ring. I don't know enough about the ring to say whether that is expected to occur, but in the tests it does and this fixes that test.

See the linked issue for more details and here for a reproducible test: https://github.com/dsabsay/cortex/tree/flaky-ring-consistency-test-repro

I validated the test locally by running my reproducer (linked above) twice (failed both times), applying this patch and running the same test (passed both times). I don't think it's worth merging the reproducer as it takes 5mins to run utilizing 16 cores fully.

Which issue(s) this PR fixes:
Fixes #6513

Checklist

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

Daniel Sabsay added 2 commits January 23, 2025 14:36
@dsabsay dsabsay force-pushed the flaky-ring-consistency-test-fix branch from 2b87236 to 28860c7 Compare January 23, 2025 22:36
@dsabsay dsabsay marked this pull request as draft January 23, 2025 23:09
@dsabsay
Copy link
Contributor Author

dsabsay commented Jan 23, 2025

Converting to draft because after rebasing master, the reproducer test is no longer failing. I need to test some more.

@dsabsay dsabsay marked this pull request as ready for review January 24, 2025 18:23
@dsabsay
Copy link
Contributor Author

dsabsay commented Jan 24, 2025

Okay, repro is behaving as expected again (failed twice in a row, passed twice in a row with this fix). This is ready for review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant