Skip to content

Commit

Permalink
[node] renew follower lease after voting (#3)
Browse files Browse the repository at this point in the history
Server remains in follower state as long as it receives valid RPCs from a leader or candidate.
  • Loading branch information
ehds authored Apr 9, 2024
1 parent 513b16b commit 1acc97a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/braft/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1806,6 +1806,7 @@ void NodeImpl::step_down(const int64_t term, bool wakeup_a_candidate,
_vote_ctx.reset(this);
} else if (_state == STATE_FOLLOWER) {
_pre_vote_ctx.reset(this);
_follower_lease.renew(PeerId());
} else if (_state <= STATE_TRANSFERRING) {
_stepdown_timer.stop();
_ballot_box->clear_pending_tasks();
Expand Down

0 comments on commit 1acc97a

Please sign in to comment.