Skip to content

Commit

Permalink
Merge branch 'master' into fix-typo
Browse files Browse the repository at this point in the history
  • Loading branch information
BusyJay authored May 15, 2024
2 parents e2aab23 + 1ccd1f3 commit e75facf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/raft.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1147,12 +1147,14 @@ impl<T: Storage> Raft<T> {
let pending_request_snapshot = self.pending_request_snapshot;
self.reset(term);
self.leader_id = leader_id;
let from_role = self.state;
self.state = StateRole::Follower;
self.pending_request_snapshot = pending_request_snapshot;
info!(
self.logger,
"became follower at term {term}",
term = self.term;
"from_role" => ?from_role,
);
}

Expand Down Expand Up @@ -1365,6 +1367,7 @@ impl<T: Storage> Raft<T> {
"term" => self.term,
"remaining ticks" => self.election_timeout - self.election_elapsed,
"msg type" => ?m.get_msg_type(),
"leader_id" => self.leader_id,
);

return Ok(());
Expand Down

0 comments on commit e75facf

Please sign in to comment.