Skip to content

Commit

Permalink
Reset election timer on leadership take over request (#357)
Browse files Browse the repository at this point in the history
* If we don't reset the timer, another vote can be initiate which will
disrupt the take over task.
  • Loading branch information
greensky00 committed May 31, 2022
1 parent 354de7f commit 9d7c4cb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/handle_custom_notification.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,12 @@ ptr<resp_msg> raft_server::handle_leadership_takeover

// Initiate force vote (ignoring priority).
initiate_vote(true);

// restart the election timer if this is not yet a leader
if (role_ != srv_role::leader) {
restart_election_timer();
}

return resp;
}

Expand Down

0 comments on commit 9d7c4cb

Please sign in to comment.