Skip to content

Commit 52d84aa

Browse files
authored
fix naming and doc for maybe_snapshot_abort (#478)
Signed-off-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
1 parent 2357cb2 commit 52d84aa

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/raft.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1766,10 +1766,10 @@ impl<T: Storage> Raft<T> {
17661766
match pr.state {
17671767
ProgressState::Probe => pr.become_replicate(),
17681768
ProgressState::Snapshot => {
1769-
if pr.maybe_snapshot_abort() {
1769+
if pr.is_snapshot_caught_up() {
17701770
debug!(
17711771
self.r.logger,
1772-
"snapshot aborted, resumed sending replication messages to {from}",
1772+
"snapshot caught up, resumed sending replication messages to {from}",
17731773
from = m.from;
17741774
"progress" => ?pr,
17751775
);

src/tracker/progress.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,9 @@ impl Progress {
125125
self.pending_snapshot = 0;
126126
}
127127

128-
/// Unsets pendingSnapshot if Match is equal or higher than
129-
/// the pendingSnapshot
128+
/// Returns true if Match is equal or higher than the pendingSnapshot.
130129
#[inline]
131-
pub fn maybe_snapshot_abort(&self) -> bool {
130+
pub fn is_snapshot_caught_up(&self) -> bool {
132131
self.state == ProgressState::Snapshot && self.matched >= self.pending_snapshot
133132
}
134133

0 commit comments

Comments
 (0)