Commit d8236ea2 authored by antirez's avatar antirez
Browse files

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.
parent 6adf3ca7
......@@ -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;
}
......
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