diff --git a/raft.go b/raft.go index 34a6607c..1b52a163 100644 --- a/raft.go +++ b/raft.go @@ -644,7 +644,7 @@ func (r *raft) maybeSendAppend(to uint64, sendIfEmpty bool) bool { Entries: ents, Commit: r.raftLog.committed, }) - pr.UpdateOnEntriesSend(len(ents), uint64(payloadsSize(ents))) + pr.SentEntries(len(ents), uint64(payloadsSize(ents))) pr.SentCommit(r.raftLog.committed) return true } diff --git a/tracker/progress.go b/tracker/progress.go index d8da735b..44317340 100644 --- a/tracker/progress.go +++ b/tracker/progress.go @@ -168,12 +168,12 @@ func (pr *Progress) BecomeSnapshot(snapshoti uint64) { pr.pendingCommit = snapshoti } -// UpdateOnEntriesSend updates the progress on the given number of consecutive -// entries being sent in a MsgApp, with the given total bytes size, appended at -// log indices >= pr.Next. +// SentEntries updates the progress on the given number of consecutive entries +// being sent in a MsgApp, with the given total bytes size, appended at log +// indices >= pr.Next. // // Must be used with StateProbe or StateReplicate. -func (pr *Progress) UpdateOnEntriesSend(entries int, bytes uint64) { +func (pr *Progress) SentEntries(entries int, bytes uint64) { switch pr.State { case StateReplicate: if entries > 0 {