Skip to content

Commit

Permalink
Merge branch 'master' into ilya/immediate-broadcast
Browse files Browse the repository at this point in the history
  • Loading branch information
andreev-io authored Dec 1, 2021
2 parents 51c82f7 + 0e84c50 commit 8f0e866
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions little_raft/src/replica.rs
Original file line number Diff line number Diff line change
Expand Up @@ -418,10 +418,11 @@ where
// to the Raft paper's guidance on decreasing next_index by
// one at a time, but is more performant in cases when we
// can cut straight to the follower's last_index+1.
let mismatch_index = mismatch_index.unwrap();
if mismatch_index < self.next_index[&from_id] {
let next_index = cmp::min(mismatch_index, last_index + 1);
self.next_index.insert(from_id, next_index);
if let Some(mismatch_index) = mismatch_index {
if mismatch_index < self.next_index[&from_id] {
let next_index = cmp::min(mismatch_index, last_index + 1);
self.next_index.insert(from_id, next_index);
}
}
}
}
Expand Down

0 comments on commit 8f0e866

Please sign in to comment.