Skip to content

Commit

Permalink
update comment
Browse files Browse the repository at this point in the history
Signed-off-by: Binbin <[email protected]>
  • Loading branch information
enjoy-binbin committed Sep 24, 2024
1 parent 0d13f5d commit ce0e75e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/cluster_legacy.c
Original file line number Diff line number Diff line change
Expand Up @@ -3138,7 +3138,7 @@ int clusterProcessPacket(clusterLink *link) {

if (server.cluster->failover_auth_time && sender->configEpoch >= server.cluster->failover_auth_epoch) {
/* Another node has claimed an epoch greater than or equal to ours.
* If we have an ongoing election, reset it because we cannot win
* If we have an ongoing election, reset it because we cannot win
* with an epoch smaller than or equal to the incoming claim. This
* allows us to start a new election as soon as possible. */
server.cluster->failover_auth_time = 0;
Expand All @@ -3147,6 +3147,8 @@ int clusterProcessPacket(clusterLink *link) {
"with an equal or higher epoch %llu. Resetting the election since we cannot win.",
(unsigned long long)server.cluster->failover_auth_epoch, sender->name, sender->human_nodename,
(unsigned long long)sender->configEpoch);
/* Maybe we could start a new election, set a flag here to make sure
* we check as soon as possible, instead of waiting for a cron. */
clusterDoBeforeSleep(CLUSTER_TODO_HANDLE_FAILOVER);
}
}
Expand Down

0 comments on commit ce0e75e

Please sign in to comment.