-
Notifications
You must be signed in to change notification settings - Fork 43
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 the check for ":0@0" in CLUSTER NODES result #199
Fix the check for ":0@0" in CLUSTER NODES result #199
Conversation
… 'cluster nodes' result. The current implementation assumes that the entire part is only 2 characters when the IP and port are not set (IP is empty and port is 0). However, this is incorrect because the '@cport' is also present so the current check fails. Additionally, there may be an optional ',hostname' as well which is not accounted for.
Good finding. |
I found an example in an issue where If I understand it correctly it's in scenarios where node-ips are reused for new cluster nodes, |
Yes. that example that you linked is precisely what was seen in our Redis Cluster. Hence the need for the fix :-). I'll try to add a test case to cover this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's merge this and include in the release. It's small enough to merge without a test case.
The current implementation assumes that the entire part is only 2 characters when the IP and port are not set (IP is empty and port is 0). However, this is incorrect because the '@cport' is also present so the current check fails. Additionally, there may be an optional ',hostname' as well which is not accounted for.
The fix here simply changes the logic from "if the part is ':0'" to "if the part starts with ':0'".