diff --git a/little_raft/src/replica.rs b/little_raft/src/replica.rs index 35bcc87..a3e8974 100644 --- a/little_raft/src/replica.rs +++ b/little_raft/src/replica.rs @@ -703,5 +703,9 @@ where last_log_index: self.log.len() - 1, last_log_term: self.log[self.log.len() - 1].term, }); + + if self.peer_ids.len() == 0 { + self.become_leader(); + } } }