redis-cli: Do DNS lookup before sending CLUSTER MEET#10436
redis-cli: Do DNS lookup before sending CLUSTER MEET#10436yossigo merged 3 commits intoredis:unstablefrom
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.
@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)