Unverified Commit c2b0c13d authored by Binbin's avatar Binbin Committed by GitHub
Browse files

Fix Invalid node address specified in redis-cli --cluster create/add-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.
parent 13d25dd9
...@@ -6341,10 +6341,10 @@ assign_replicas: ...@@ -6341,10 +6341,10 @@ assign_replicas:
* So if (bus_port == 0) or (bus_port == port + CLUSTER_MANAGER_PORT_INCR), * So if (bus_port == 0) or (bus_port == port + CLUSTER_MANAGER_PORT_INCR),
* we just call CLUSTER MEET with 2 arguments, using the old form. */ * we just call CLUSTER MEET with 2 arguments, using the old form. */
reply = CLUSTER_MANAGER_COMMAND(node, "cluster meet %s %d", reply = CLUSTER_MANAGER_COMMAND(node, "cluster meet %s %d",
first->ip, first->port); first_ip, first->port);
} else { } else {
reply = CLUSTER_MANAGER_COMMAND(node, "cluster meet %s %d %d", reply = CLUSTER_MANAGER_COMMAND(node, "cluster meet %s %d %d",
first->ip, first->port, first->bus_port); first_ip, first->port, first->bus_port);
} }
int is_err = 0; int is_err = 0;
if (reply != NULL) { if (reply != NULL) {
...@@ -6535,7 +6535,7 @@ static int clusterManagerCommandAddNode(int argc, char **argv) { ...@@ -6535,7 +6535,7 @@ static int clusterManagerCommandAddNode(int argc, char **argv) {
first_ip, first->port); first_ip, first->port);
} else { } else {
reply = CLUSTER_MANAGER_COMMAND(new_node, "CLUSTER MEET %s %d %d", reply = CLUSTER_MANAGER_COMMAND(new_node, "CLUSTER MEET %s %d %d",
first->ip, first->port, first->bus_port); first_ip, first->port, first->bus_port);
} }
if (!(success = clusterManagerCheckRedisReply(new_node, reply, NULL))) if (!(success = clusterManagerCheckRedisReply(new_node, reply, NULL)))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment