mirror of
https://github.com/fluencelabs/redis
synced 2025-03-31 23:01:03 +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,8 +4176,11 @@ void clusterCommand(redisClient *c) {
|
|||||||
if (nodeIsMaster(myself)) {
|
if (nodeIsMaster(myself)) {
|
||||||
addReplyError(c,"You should send CLUSTER FAILOVER to a slave");
|
addReplyError(c,"You should send CLUSTER FAILOVER to a slave");
|
||||||
return;
|
return;
|
||||||
|
} else if (myself->slaveof == NULL) {
|
||||||
|
addReplyError(c,"I'm a slave but my master is unknown to me");
|
||||||
|
return;
|
||||||
} else if (!force &&
|
} else if (!force &&
|
||||||
(myself->slaveof == NULL || nodeFailed(myself->slaveof) ||
|
(nodeFailed(myself->slaveof) ||
|
||||||
myself->slaveof->link == NULL))
|
myself->slaveof->link == NULL))
|
||||||
{
|
{
|
||||||
addReplyError(c,"Master is down or failed, "
|
addReplyError(c,"Master is down or failed, "
|
||||||
|
Loading…
x
Reference in New Issue
Block a user