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
c2595500
Commit
c2595500
authored
Mar 14, 2013
by
antirez
Browse files
Cluster: request failover authorization, log if we have quorum.
However the failover is yet not really performed.
parent
7fa42b80
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/cluster.c
View file @
c2595500
...
...
@@ -1325,7 +1325,7 @@ void clusterSendFailoverAuthIfNeeded(clusterNode *node) {
}
/* This function is called if we are a slave node and our master serving
* a non-zero amount of hash slots is in
P
FAIL state.
* a non-zero amount of hash slots is in FAIL state.
*
* The gaol of this function is:
* 1) To check if we are able to perform a failover, is our data updated?
...
...
@@ -1352,12 +1352,14 @@ void clusterHandleSlaveFailover(void) {
server
.
cluster
->
failover_auth_time
=
time
(
NULL
);
server
.
cluster
->
failover_auth_count
=
0
;
/* TODO: Broadcast the AUTH request. */
clusterRequestFailoverAuth
();
return
;
/* Wait for replies. */
}
/* Check if we reached the quorum. */
if
(
server
.
cluster
->
failover_auth_count
>
needed_quorum
)
{
redisLog
(
REDIS_WARNING
,
"Masters quorum reached: failing over my (failing) master."
);
/* TODO: Perform election. */
/* TODO: Broadcast update to cluster. */
}
...
...
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