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 27726f51..b49b06fc 100644 --- a/tracker/progress.go +++ b/tracker/progress.go @@ -162,12 +162,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 {