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

Redis Cluster slot ranges #54

Closed
travisbell opened this issue Aug 22, 2024 · 2 comments · Fixed by #55
Closed

Redis Cluster slot ranges #54

travisbell opened this issue Aug 22, 2024 · 2 comments · Fixed by #55
Assignees
Labels
bug Something isn't working
Milestone

Comments

@travisbell
Copy link

travisbell commented Aug 22, 2024

I noticed a very small percentage of my traffic was throwing an error, and I was confused as to why until I saw the code below. It's a subtle bug in the code that calculates the slot ranges:

range = Range.new(*slots, exclude_end: false)

With exclude_end defined, the ranges are not including their last values.

Range.new(*[12288, 16383], exclude_end: false)
=> 12288...16383

Whereas, we want to include the last values:

Range.new(*[12288, 16383])
=> 12288..16383

This was causing the last slot for every node to not be found using RangeMap#find.

@ioquatix
Copy link
Member

Sorry about this, that looks like a bug!

@ioquatix ioquatix self-assigned this Aug 22, 2024
@ioquatix ioquatix added the bug Something isn't working label Aug 22, 2024
@ioquatix ioquatix added this to the v0.10.0 milestone Aug 22, 2024
@ioquatix
Copy link
Member

Fix released, please let me know how you get on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants