mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-23 08:38:27 -05:00
Cluster: broadcast pong to other slaves in the same ring.
When we schedule a failover, broadcast a PONG to the slaves. The other slaves that plan to get elected will do the same too, this way it is likely that every slave will have a good picture of its own rank. Note that this is N*N messages where N is the number of slaves for the failing master, however usually even large clusters have many master nodes but a limited number of replicas per node, so this is harmless.
This commit is contained in:
parent
e2b59621a8
commit
3582054982
@ -2016,6 +2016,10 @@ void clusterHandleSlaveFailover(void) {
|
||||
server.cluster->failover_auth_time - mstime(),
|
||||
server.cluster->failover_auth_rank,
|
||||
replicationGetSlaveOffset());
|
||||
/* Now that we have a scheduled election, broadcast our offset
|
||||
* to all the other slaves so that they'll updated their offsets
|
||||
* if our offset is better. */
|
||||
clusterBroadcastPong(CLUSTER_BROADCAST_LOCAL_SLAVES);
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user