提交 47bbaa17 编写于 作者: A antirez

Cluster: separate unknown master check from the rest.

In no case we should try to attempt to failover if myself->slaveof is
NULL.
上级 0595420b
...@@ -4176,9 +4176,12 @@ void clusterCommand(redisClient *c) { ...@@ -4176,9 +4176,12 @@ 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, "
"please use CLUSTER FAILOVER FORCE"); "please use CLUSTER FAILOVER FORCE");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册