mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 09:00:51 +00:00
Cluster: request failover authorization, log if we have quorum.
However the failover is yet not really performed.
This commit is contained in:
parent
7fa42b801d
commit
c2595500ac
@ -1325,7 +1325,7 @@ void clusterSendFailoverAuthIfNeeded(clusterNode *node) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* This function is called if we are a slave node and our master serving
|
/* This function is called if we are a slave node and our master serving
|
||||||
* a non-zero amount of hash slots is in PFAIL state.
|
* a non-zero amount of hash slots is in FAIL state.
|
||||||
*
|
*
|
||||||
* The gaol of this function is:
|
* The gaol of this function is:
|
||||||
* 1) To check if we are able to perform a failover, is our data updated?
|
* 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_time = time(NULL);
|
||||||
server.cluster->failover_auth_count = 0;
|
server.cluster->failover_auth_count = 0;
|
||||||
|
|
||||||
/* TODO: Broadcast the AUTH request. */
|
clusterRequestFailoverAuth();
|
||||||
return; /* Wait for replies. */
|
return; /* Wait for replies. */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check if we reached the quorum. */
|
/* Check if we reached the quorum. */
|
||||||
if (server.cluster->failover_auth_count > needed_quorum) {
|
if (server.cluster->failover_auth_count > needed_quorum) {
|
||||||
|
redisLog(REDIS_WARNING,
|
||||||
|
"Masters quorum reached: failing over my (failing) master.");
|
||||||
/* TODO: Perform election. */
|
/* TODO: Perform election. */
|
||||||
/* TODO: Broadcast update to cluster. */
|
/* TODO: Broadcast update to cluster. */
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user