-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Fix Invalid node address specified in redis-cli --cluster create/add-node #11151
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 Invalid node address specified in redis-cli --cluster create/add-node #11151
Conversation
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.
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.
LGTM.
Some of the changes in #10436 reverts first_ip (always an IP) to first->ip (may be an IP or a hostname). It may have been a merge conflict which wasn't resolved properly.
For the release notes, it's good to supply a short text that Oran can copy-paste to the release notes.
yes, i guess so, sorry for the mistake, i'm must say that I didn't take a deep look in your DNS lookup PR during the rebase/merge conflict, this is a mistake that shouldn't be |
|
@enjoy-binbin Don't worry! Thanks for fixing it! |
|
@enjoy-binbin Can you add a brief summary of the problem that we can add to the release notes. |
|
I'm wondering if we should add some tests for this, I checked it out locally to validate the fix. |
i added it in the top comment, hope i made it clear
thanks for the check, i also did it locally to validate this. And yes, i think we should, but in #10436, i see @zuiderkwast dropping the tests for some reasons, do you think we can add the tests? |
|
@enjoy-binbin I didn't drop any test, did I? Do you mean I skipped adding a test? That's true, probably because I was lazy or I didn't have time. A test would be better than no test of course, but I think this can be merged without a test too. |
|
i mean this 2ae3c59, using "localhost", do you think i can bring it (localhost part) back? i can take a look in it when i am free.
yes, i think this one is safe to merge, but it would be greet if we have some tests to cover it, i will try "localhost" when i have times |
|
i am not able to add the localhost test without the I tried these confs:
|
|
This sounds familiar. @yossigo didn't like "prefer IPv4 over IPv6". That's why I dropped the tests with "localhost" before. The discussion is here: #10436 (comment). He mentioned that |
|
@enjoy-binbin Did you try The default, as described by RFC 3484 is to prefer IPv6. To change that, you can add the following line to the end of your Reconsidering this, I agree we can't assume users go around changing system files for this purpose. Perhaps we should explicitly support a |
the test was hang in somewhere
i see in ours test-ubantu-latest and test-sanitizer-address, both resolve to ::1, like both are sending CLUSTER MEET ::1. and i see the /etc/hosts in test-ubantu-latest is:
the -4 / -6 flag looks like a good idea, i will give it a try next day |
…luster_dns_lookup
…-cli adding -4 and -6 options Co-authored-by: Viktor Söderqvist <viktor.soderqvist@est.tech> Co-authored-by: Yossi Gottlieb <yossigo@gmail.com>
c315147 to
b72581d
Compare
|
i am adding the -4 / -6 options for redis-cli, can see if we need it... it can also be a separate PR (don't want the fix blocked by it) i see hiredis add this option as well in: redis/hiredis#1096 |
Co-authored-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
|
@yossigo @madolson any reason this wasn't merged (i didn't read the correspondence) @enjoy-binbin i understand this fixes a bug that was introduced in 7.0.3 and adds some new CLI options, does it have a chance to break anything? |
|
I think we can just fix the bug, it's very safe to merge. And postpone the clI options, no need to rush it now. I reverted it back, let's merge it first and see if cli options are needed later |
|
@oranagra AFAICT the added cli options can't break anything since the default behaviour is unchanged. The options made it possible to reliably test dns lookup in CI though. I suppose they could be done in a separate PR but otoh they enable testing of this PR. |
|
I'm gonna assume Yossi and Madelyn are too busy at the moment, and i don't like to leave this bugfix out of the next release, so i'll merge the fix as is, and we can open another PR to add the test and the new options. |
|
@enjoy-binbin Are you going to open a separate PR with the -4 and -6 options? |
|
@zuiderkwast yean, on my way :) Ok, done, #11315 |
…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.
…NS lookup (#11315) This PR, we added -4 and -6 options to redis-cli to determine IPV4 / IPV6 priority in DNS lookup. This was mentioned in #11151 (comment) For now it's only used in CLUSTER MEET. The options also made it possible to reliably test dns lookup in CI, using this option, we can add some localhost tests for #11151. The commit was cherry-picked from #11151, back then we decided to split the PR. Co-authored-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
…NS lookup (redis#11315) This PR, we added -4 and -6 options to redis-cli to determine IPV4 / IPV6 priority in DNS lookup. This was mentioned in redis#11151 (comment) For now it's only used in CLUSTER MEET. The options also made it possible to reliably test dns lookup in CI, using this option, we can add some localhost tests for redis#11151. The commit was cherry-picked from redis#11151, back then we decided to split the PR. Co-authored-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
This bug was introduced in #10344 (7.0.3), and it breaks the
redis-cli --cluster create usage in #10436 (7.0 RC3).
At the same time, the cluster-port support introduced in #10344
cannot use the DNS lookup brought by #10436.
Fixes #11148