Skip to content

Commit

Permalink
tracker: use a simpler SentEntires method name
Browse files Browse the repository at this point in the history
Signed-off-by: Pavel Kalinnikov <[email protected]>
  • Loading branch information
pav-kv committed Mar 6, 2024
1 parent 4399f8f commit 8b05a9d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion raft.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
8 changes: 4 additions & 4 deletions tracker/progress.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 8b05a9d

Please sign in to comment.