Cluster: more robust slave check in CLUSTER REPLICATE.

There are rare conditions where node->slaveof may be NULL even if the
node is a slave. To check by flag is much more robust.
This commit is contained in:
antirez 2015-03-18 12:09:31 +01:00
parent 61fb441c8c
commit 438a1a84e8

View File

@ -4071,7 +4071,7 @@ void clusterCommand(redisClient *c) {
}
/* Can't replicate a slave. */
if (n->slaveof != NULL) {
if (nodeIsSlave(n)) {
addReplyError(c,"I can only replicate a master, not a slave.");
return;
}