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
42fa46e4
Commit
42fa46e4
authored
Sep 26, 2013
by
antirez
Browse files
Cluster: removed an old source of delay to start the slave failover.
parent
a445aa30
Changes
1
Show whitespace changes
Inline
Side-by-side
src/cluster.c
View file @
42fa46e4
...
@@ -1624,7 +1624,7 @@ void clusterHandleSlaveFailover(void) {
...
@@ -1624,7 +1624,7 @@ void clusterHandleSlaveFailover(void) {
if
(
mstime
()
<
server
.
cluster
->
failover_auth_time
)
return
;
if
(
mstime
()
<
server
.
cluster
->
failover_auth_time
)
return
;
/* Return ASAP if the election is too old to be valid. */
/* Return ASAP if the election is too old to be valid. */
if
(
mstime
()
-
server
.
cluster
->
failover_auth_time
>
server
.
cluster_node_timeout
)
if
(
mstime
()
-
server
.
cluster
->
failover_auth_time
>
server
.
cluster_node_timeout
*
1000
)
return
;
return
;
/* Ask for votes if needed. */
/* Ask for votes if needed. */
...
@@ -1835,16 +1835,10 @@ void clusterCron(void) {
...
@@ -1835,16 +1835,10 @@ void clusterCron(void) {
}
}
/* If we are a slave and our master is down, but is serving slots,
/* If we are a slave and our master is down, but is serving slots,
* call the function that handles the failover.
* call the function that handles the failover. */
* This function is called with a small delay in order to let the
* FAIL message to propagate after failure detection, this is not
* strictly required but makes 99.99% of failovers mechanically
* simpler. */
if
(
server
.
cluster
->
myself
->
flags
&
REDIS_NODE_SLAVE
&&
if
(
server
.
cluster
->
myself
->
flags
&
REDIS_NODE_SLAVE
&&
server
.
cluster
->
myself
->
slaveof
&&
server
.
cluster
->
myself
->
slaveof
&&
server
.
cluster
->
myself
->
slaveof
->
flags
&
REDIS_NODE_FAIL
&&
server
.
cluster
->
myself
->
slaveof
->
flags
&
REDIS_NODE_FAIL
&&
(
server
.
unixtime
-
server
.
cluster
->
myself
->
slaveof
->
fail_time
)
>
REDIS_CLUSTER_FAILOVER_DELAY
&&
server
.
cluster
->
myself
->
slaveof
->
numslots
!=
0
)
server
.
cluster
->
myself
->
slaveof
->
numslots
!=
0
)
{
{
clusterHandleSlaveFailover
();
clusterHandleSlaveFailover
();
...
...
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