mirror of
https://github.com/fluencelabs/redis
synced 2025-03-17 16:10:50 +00:00
Cluster: separate unknown master check from the rest.
In no case we should try to attempt to failover if myself->slaveof is NULL.
This commit is contained in:
parent
4f2555aa17
commit
230d141420
@ -4176,9 +4176,12 @@ void clusterCommand(redisClient *c) {
|
||||
if (nodeIsMaster(myself)) {
|
||||
addReplyError(c,"You should send CLUSTER FAILOVER to a slave");
|
||||
return;
|
||||
} else if (myself->slaveof == NULL) {
|
||||
addReplyError(c,"I'm a slave but my master is unknown to me");
|
||||
return;
|
||||
} else if (!force &&
|
||||
(myself->slaveof == NULL || nodeFailed(myself->slaveof) ||
|
||||
myself->slaveof->link == NULL))
|
||||
(nodeFailed(myself->slaveof) ||
|
||||
myself->slaveof->link == NULL))
|
||||
{
|
||||
addReplyError(c,"Master is down or failed, "
|
||||
"please use CLUSTER FAILOVER FORCE");
|
||||
|
Loading…
x
Reference in New Issue
Block a user