Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
a4a1c7bb
Commit
a4a1c7bb
authored
Mar 02, 2018
by
artix
Browse files
ClusterManager: fixed --cluster-from 'all' parsing
parent
5b3d73b3
Changes
1
Show whitespace changes
Inline
Side-by-side
src/redis-cli.c
View file @
a4a1c7bb
...
@@ -3137,12 +3137,12 @@ static clusterManagerNode *clusterNodeForResharding(char *id,
...
@@ -3137,12 +3137,12 @@ static clusterManagerNode *clusterNodeForResharding(char *id,
int *raise_err)
int *raise_err)
{
{
clusterManagerNode *node = NULL;
clusterManagerNode *node = NULL;
const char *invalid_node_msg = "*** The specified node is not known
or
"
const char *invalid_node_msg = "*** The specified node
(%s)
is not known "
"not a master, please retry.\n";
"
or
not a master, please retry.\n";
node = clusterManagerNodeByName(id);
node = clusterManagerNodeByName(id);
*raise_err = 0;
*raise_err = 0;
if (!node || node->flags & CLUSTER_MANAGER_FLAG_SLAVE) {
if (!node || node->flags & CLUSTER_MANAGER_FLAG_SLAVE) {
clusterManagerLogErr(invalid_node_msg);
clusterManagerLogErr(invalid_node_msg
, id
);
*raise_err = 1;
*raise_err = 1;
return NULL;
return NULL;
} else if (node != NULL && target != NULL) {
} else if (node != NULL && target != NULL) {
...
@@ -3700,6 +3700,8 @@ static int clusterManagerCommandReshard(int argc, char **argv) {
...
@@ -3700,6 +3700,8 @@ static int clusterManagerCommandReshard(int argc, char **argv) {
}
}
/* Check if there's still another source to process. */
/* Check if there's still another source to process. */
if (!all && strlen(from) > 0) {
if (!all && strlen(from) > 0) {
if (!strcmp(from, "all")) all = 1;
if (!all) {
clusterManagerNode *src =
clusterManagerNode *src =
clusterNodeForResharding(from, target, &raise_err);
clusterNodeForResharding(from, target, &raise_err);
if (src != NULL) listAddNodeTail(sources, src);
if (src != NULL) listAddNodeTail(sources, src);
...
@@ -3709,6 +3711,7 @@ static int clusterManagerCommandReshard(int argc, char **argv) {
...
@@ -3709,6 +3711,7 @@ static int clusterManagerCommandReshard(int argc, char **argv) {
}
}
}
}
}
}
}
listIter li;
listIter li;
listNode *ln;
listNode *ln;
if (all) {
if (all) {
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment