diff options
author | Binbin <binloveplay1314@qq.com> | 2022-07-11 16:23:31 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-11 11:23:31 +0300 |
commit | 35e8ae3eb5f80ebb5cad5b509d1fde56176bca0d (patch) | |
tree | 9241202d6fd88a630e388b76a6bd5625a2aa2dca /tests/support | |
parent | 1e85b89aefe8e7e24a46bd1c8fb251fdab024b74 (diff) | |
download | redis-35e8ae3eb5f80ebb5cad5b509d1fde56176bca0d.tar.gz |
Add cluster-port support to redis-cli --cluster (#10344)
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.
Co-authored-by: Madelyn Olson <34459052+madolson@users.noreply.github.com>
Diffstat (limited to 'tests/support')
-rw-r--r-- | tests/support/util.tcl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/support/util.tcl b/tests/support/util.tcl index 6741b719a..fd72dcf75 100644 --- a/tests/support/util.tcl +++ b/tests/support/util.tcl @@ -72,8 +72,8 @@ proc sanitizer_errors_from_file {filename} { } proc getInfoProperty {infostr property} { - if {[regexp "\r\n$property:(.*?)\r\n" $infostr _ value]} { - set _ $value + if {[regexp -lineanchor "^$property:(.*?)\r\n" $infostr _ value]} { + return $value } } |