From d8236ea262f947ac27f5e2e324511796609a1752 Mon Sep 17 00:00:00 2001 From: antirez Date: Wed, 18 Mar 2015 12:09:31 +0100 Subject: [PATCH] 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. --- src/cluster.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cluster.c b/src/cluster.c index 74371f3e..80cd7701 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -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; }