diff --git a/raft.go b/raft.go index 16545836..a2e5ad0f 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 65a2ee60..1b594cf3 100644 --- a/tracker/progress.go +++ b/tracker/progress.go @@ -154,12 +154,12 @@ func (pr *Progress) BecomeSnapshot(snapshoti uint64) { pr.sentCommit = 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 {