-
Notifications
You must be signed in to change notification settings - Fork 24.4k
redis-cli: Do DNS lookup before sending CLUSTER MEET #10436
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-cli: Do DNS lookup before sending CLUSTER MEET #10436
Conversation
|
Yes, let me try! 🚀 |
|
It works, thanks! 🎉 Seems a new Here is the logs: |
|
Do some test: |
|
Great! Thanks for testing! Do you want to try --cluster add-node too? It is also affected. It's using CLUSTER MEET and does DNS lookup in the same way. |
|
It seems also works 👍 Here are the logs: |
yossigo
left a comment
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.
@zuiderkwast Maybe use localhost for a test? I think we can assume that it will always work.
|
It seems localhost also works. I tested create cluster and add node and succeeded. conf: These are the succeeded logs: |
|
I tried putting localhost in various places in the hostname cluster test suite. On my laptop I get |
@yossigo Done. Also changed to prefer IPv4 over IPv6 (new flag for anetResolve) which is what hiredis does. |
|
@zuiderkwast There are other options to fix the tests:
But I'm not sure if any of that is worth the trouble, I think I'd just go with the previous implementation and no test. |
This reverts commit 49055c3.
|
@yossigo If we bind to ::1 instead of 127.0.0.1, there are a lot of tests which fail, probably becuase they're hard-coded to 127.0.0.1. If we bind to both, tests fail too (not sure why but I guess the test machinery takes the value to be a single IP address). Regarding HOSTALIASES: The file maps alias names to canonical host names, but the canonical name must be resolvable IIUC. I don't think you can specify an IP address as the target. I have reverted to the original implementation without tests, as suggested. |
@liuchong You need to use |
Yes, the problem is solved, thanks! Forgot the |
This bug was introduced in redis#10344 (7.0.3), and it breaks the redis-cli --cluster create usage in redis#10436 (7.0 RC3). At the same time, the cluster-port support introduced in redis#10344 cannot use the DNS lookup brought by redis#10436.
…node (redis#11151) This bug was introduced in redis#10344 (7.0.3), and it breaks the redis-cli --cluster create usage in redis#10436 (7.0 RC3). At the same time, the cluster-port support introduced in redis#10344 cannot use the DNS lookup brought by redis#10436.
…node (redis#11151) This bug was introduced in redis#10344 (7.0.3), and it breaks the redis-cli --cluster create usage in redis#10436 (7.0 RC3). At the same time, the cluster-port support introduced in redis#10344 cannot use the DNS lookup brought by redis#10436.
Affects
--cluster createand--cluster add-node.Fixes #10433.
There are no tests added. (Is it possible without setting up DNS records? Can we create a hosts file in github actions?)
@liuchong can you test this with your nodes? (
redis-cli --cluster create redis-node-1:7001 redis-node-2:7002 redis-node-3:7003 redis-node-4:7004 redis-node-5:7005 redis-node-6:7006 --cluster-replicas 1)