Skip to content

Conversation

@enjoy-binbin
Copy link
Contributor

@enjoy-binbin enjoy-binbin commented Feb 25, 2022

In #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.

Fixes #10342. Fixes #10954

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
@hwware
Copy link
Contributor

hwware commented Feb 25, 2022

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

@satheeshaGowda
Copy link

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 .

@enjoy-binbin enjoy-binbin requested a review from madolson March 10, 2022 04:03
Copy link
Contributor

@madolson madolson left a 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.

@madolson
Copy link
Contributor

madolson commented Jul 7, 2022

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?

@enjoy-binbin
Copy link
Contributor Author

@madolson yes, i was planning to do a rebase today too
i can take care of it, and then take care of the comments, thanks for the review

@enjoy-binbin enjoy-binbin marked this pull request as draft July 7, 2022 06:39
Copy link
Contributor

@madolson madolson left a 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.

@madolson madolson added release-notes indication that this issue needs to be mentioned in the release notes state:major-decision Requires core team consensus approval-needed Waiting for core team approval to be merged labels Jul 10, 2022
Copy link
Member

@oranagra oranagra left a 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.

@oranagra
Copy link
Member

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 redis-cli --cluster info and redis-cli --cluster backup.
i think the one in --cluster backup is harmless, but the one in --cluster info could cause some script that parses that to fail.

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?

@enjoy-binbin
Copy link
Contributor Author

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

yes, after i refreshed this PR, realize the change is not that important, i have a thought to remove it, #10344 (comment)

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)?

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

Copy link
Member

@oranagra oranagra left a 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

@enjoy-binbin
Copy link
Contributor Author

enjoy-binbin commented Jul 11, 2022

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...
I looked at this json file and it's more like logging stuff than for restoring the cluster.
I modified it at the time for completeness, no a strong will, we can re-think it in 7.2 if we need that --cluster restore command

@oranagra oranagra merged commit 35e8ae3 into redis:unstable Jul 11, 2022
@enjoy-binbin enjoy-binbin deleted the redis_cli_cluster_bus_port branch July 11, 2022 08:23
@oranagra oranagra mentioned this pull request Jul 11, 2022
@oranagra
Copy link
Member

for the record, before merging i triggered both cluster tests and the unit/cluster one:
https://github.com/redis/redis/actions/runs/2648128963
https://github.com/redis/redis/actions/runs/2648135573

enjoy-binbin added a commit to enjoy-binbin/redis that referenced this pull request Aug 19, 2022
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.
oranagra pushed a commit that referenced this pull request Sep 19, 2022
…node (#11151)

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.
oranagra pushed a commit that referenced this pull request Sep 21, 2022
…node (#11151)

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.

(cherry picked from commit c2b0c13)
madolson pushed a commit to madolson/redis that referenced this pull request Apr 19, 2023
…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.
enjoy-binbin added a commit to enjoy-binbin/redis that referenced this pull request Jul 31, 2023
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>
enjoy-binbin added a commit to enjoy-binbin/redis that referenced this pull request Jul 31, 2023
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approval-needed Waiting for core team approval to be merged release-notes indication that this issue needs to be mentioned in the release notes state:major-decision Requires core team consensus

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Redis cluster bus port redis-cli --cluster create , failing to create cluster.

7 participants