-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Add cluster-port support to redis-cli --cluster #10344
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
Add cluster-port support to redis-cli --cluster #10344
Conversation
In redis#9389, we add a new cluster-port config and make cluster bus port configurable. Now add support for this parameter in redis-cli. Mainly for `--cluster create` and `--cluster add-node`, we can use `ip:port@bus_port` to pass the `cluster-port` parameter. The bus_port is optional, if not specified it is the same as before. Also add the `bus_port` field in `--cluster backup`, we also need to backup the `cluster-port`. Fixes redis#10342
|
I think code part is ok, but could you please add test in the same PR, then if the CI failed after this PR merged, we could easily locate where the issue probably comes from. Thanks |
|
Hello @enjoy-binbin if we are good with this approved PR (dont see any pending actions), could you please merge it? we are kind of blocked on this for now, thanks for understanding . |
madolson
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.
High level LGTM, just some minor comments.
|
This seems like something we can merge back into 7.0, I see someone was blocked on it, and the actual major decision is small. @enjoy-binbin Do you have time to rebase and we can get it merged ASAP? |
|
@madolson yes, i was planning to do a rebase today too |
to be a bit cleaner Co-authored-by: Madelyn Olson <34459052+madolson@users.noreply.github.com>
madolson
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.
LGTM. @redis/core-team I'm not entirely sure if this is a major decision, I think we decided that tool API changes count. Please check the top comment and comment.
oranagra
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.
LGTM (didn't look deeply into the code).
We do consider interface changes in tools as major decisions, but this PR doesn't have an interface change.
|
Ohh, i was looking for the interface change in redis (remembered the one that was removed), but actually the remaining interface changes are described in the top comment, in As far as i can tell these changes are not required for the fix in this ticket and are not strictly required for the new cluster-port feature to be useful, so maybe we should remove them from this PR, and introduce them in 7.2 (to avoid risk of braking something in a patch-level release)? @enjoy-binbin @madolson WDYT? |
yes, after i refreshed this PR, realize the change is not that important, i have a thought to remove it, #10344 (comment)
i agree, for using cluster-port, that info change is not necessary, and it's also more safe, i am going to remove the info change. and i think madolson would agree too. i can do it in advance |
oranagra
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.
i'm not sure we want / need to add the cluster bus port to the backup json
i.e. it probably can't do any harm. but maybe such a backup doesn't have to contain that detail.
we do have a way to identify the source.. and it's not as if it holds the entire configuration so we can use that backup to restore the config too..
i suggest to drop that too, and re-consider for 7.2
|
yes i agree, i drop the info and backup changes for now, let's re-consider for 7.2 if it needed for the record, the --cluster backup was added in #5888, and artix75 said it will be a restore command in the future, but... |
|
for the record, before merging i triggered both cluster tests and the unit/cluster one: |
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.
In redis#9389, we add a new `cluster-port` config and make cluster bus port configurable, and currently redis-cli --cluster create/add-node doesn't support with a configurable `cluster-port` instance. Because redis-cli uses the old way (port + 10000) to send the `CLUSTER MEET` command. Now we add this support on redis-cli `--cluster`, note we don't need to explicitly pass in the `cluster-port` parameter, we can get the real `cluster-port` of the node in `clusterManagerNodeLoadInfo`, so the `--cluster create` and `--cluster add-node` interfaces have not changed. We will use the `cluster-port` when we are doing `CLUSTER MEET`, also note that `CLUSTER MEET` bus-port parameter was added in 4.0, so if the bus_port (the one in redis-cli) is 0, or equal (port + 10000), we just call `CLUSTER MEET` with 2 arguments, using the old form. Co-authored-by: Madelyn Olson <34459052+madolson@users.noreply.github.com>
…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.
In #9389, we add a new
cluster-portconfig and make cluster bus port configurable,and currently redis-cli --cluster create/add-node doesn't support with a configurable
cluster-portinstance.Because redis-cli uses the old way (port + 10000) to send the
CLUSTER MEETcommand.Now we add this support on redis-cli
--cluster, note we don't need to explicitly pass in thecluster-portparameter, we can get the realcluster-portof the node inclusterManagerNodeLoadInfo,so the
--cluster createand--cluster add-nodeinterfaces have not changed.We will use the
cluster-portwhen we are doingCLUSTER MEET, also note thatCLUSTER MEETbus-portparameter was added in 4.0, so if the bus_port (the one in redis-cli) is 0, or equal (port + 10000),
we just call
CLUSTER MEETwith 2 arguments, using the old form.Fixes #10342. Fixes #10954