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:39 +01:00
parent 6adf3ca798
commit d8236ea262
+1 -1
View File
@@ -4058,7 +4058,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;
}