mirror of
https://github.com/fluencelabs/redis
synced 2025-03-30 22:31:03 +00:00
render migrating and importing slots in cluster nodes info
This commit is contained in:
parent
74a640492f
commit
66f2517feb
@ -1086,6 +1086,21 @@ sds clusterGenNodesDescription(void) {
|
|||||||
start = -1;
|
start = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Just for MYSELF node we also dump info about slots that
|
||||||
|
* we are migrating to other instances or importing from other
|
||||||
|
* instances. */
|
||||||
|
if (node->flags & REDIS_NODE_MYSELF) {
|
||||||
|
for (j = 0; j < REDIS_CLUSTER_SLOTS; j++) {
|
||||||
|
if (server.cluster.migrating_slots_to[j]) {
|
||||||
|
ci = sdscatprintf(ci," [%d->%.40s]",j,
|
||||||
|
server.cluster.migrating_slots_to[j]->name);
|
||||||
|
} else if (server.cluster.importing_slots_from[j]) {
|
||||||
|
ci = sdscatprintf(ci," [%d<-%.40s]",j,
|
||||||
|
server.cluster.importing_slots_from[j]->name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
ci = sdscatlen(ci,"\n",1);
|
ci = sdscatlen(ci,"\n",1);
|
||||||
}
|
}
|
||||||
dictReleaseIterator(di);
|
dictReleaseIterator(di);
|
||||||
@ -1206,6 +1221,7 @@ void clusterCommand(redisClient *c) {
|
|||||||
} else {
|
} else {
|
||||||
addReplyError(c,"Invalid CLUSTER SETSLOT action or number of arguments");
|
addReplyError(c,"Invalid CLUSTER SETSLOT action or number of arguments");
|
||||||
}
|
}
|
||||||
|
addReply(c,shared.ok);
|
||||||
} else if (!strcasecmp(c->argv[1]->ptr,"info") && c->argc == 2) {
|
} else if (!strcasecmp(c->argv[1]->ptr,"info") && c->argc == 2) {
|
||||||
char *statestr[] = {"ok","fail","needhelp"};
|
char *statestr[] = {"ok","fail","needhelp"};
|
||||||
int slots_assigned = 0, slots_ok = 0, slots_pfail = 0, slots_fail = 0;
|
int slots_assigned = 0, slots_ok = 0, slots_pfail = 0, slots_fail = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user