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 cluster node selection for SCAN, SSCAN, HSCAN, ZSCAN #1063

Merged
merged 2 commits into from
Feb 2, 2022

Conversation

cmcinnes-mdsol
Copy link
Contributor

We found that while using SSCAN on a stable cluster (where no hash slots are being moved from one node to another) we were getting a lot of MOVED responses.

Upon investigation we saw that for SSCAN the client was selecting a random writer node. I may be missing the original intent of the removed branch of the case statement but it seems like we shouldn't care about the position of the match option as the argument for it is a pattern not a key. Before this change Cluster#find_node_key was returning nil for all flavors of scan which was causing Cluster#find_node to select a random node. Tested out this branch and the MOVED responses went away while SSCAN continued to function normally.

@byroot byroot merged commit 64e2664 into redis:master Feb 2, 2022
@cmcinnes-mdsol
Copy link
Contributor Author

thanks for the quick merge! do we think this is worth a changelog entry? if so can open another pr

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