diff --git a/src/raft.rs b/src/raft.rs index 83477350..91d90209 100644 --- a/src/raft.rs +++ b/src/raft.rs @@ -1147,12 +1147,14 @@ impl Raft { 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, ); } @@ -1365,6 +1367,7 @@ impl Raft { "term" => self.term, "remaining ticks" => self.election_timeout - self.election_elapsed, "msg type" => ?m.get_msg_type(), + "leader_id" => self.leader_id, ); return Ok(());