mirror of
https://github.com/fluencelabs/redis
synced 2025-03-17 16:10:50 +00:00
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:
parent
61fb441c8c
commit
438a1a84e8
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user