From 70bf464cd609b52a4cccbe5dff1ebe7fb98f580d Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Fri, 3 Oct 2014 13:42:34 +0800 Subject: [PATCH] raft: add comment to decrTo --- raft/raft.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/raft/raft.go b/raft/raft.go index a223931cd..323e596a9 100644 --- a/raft/raft.go +++ b/raft/raft.go @@ -69,6 +69,8 @@ func (pr *progress) update(n int64) { pr.next = n + 1 } +// maybeDecrTo returns false if the given to index comes from an out of order message. +// Otherwise it decreases the progress next index and returns true. func (pr *progress) maybeDecrTo(to int64) bool { // the rejection must be stale if the // progress has matched with follower