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