Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
230d1414
Commit
230d1414
authored
Mar 20, 2015
by
antirez
Browse files
Cluster: separate unknown master check from the rest.
In no case we should try to attempt to failover if myself->slaveof is NULL.
parent
4f2555aa
Changes
1
Show whitespace changes
Inline
Side-by-side
src/cluster.c
View file @
230d1414
...
...
@@ -4176,8 +4176,11 @@ 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
)
||
(
nodeFailed
(
myself
->
slaveof
)
||
myself
->
slaveof
->
link
==
NULL
))
{
addReplyError
(
c
,
"Master is down or failed, "
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment