Merge pull request #5768 from gyuho/raft_comment

raft: fix comment, method name in progress
This commit is contained in:
Gyu-Ho Lee 2016-06-24 08:38:02 -07:00 committed by GitHub
commit 15b267fbfd
2 changed files with 4 additions and 4 deletions

View File

@ -167,9 +167,9 @@ func (pr *Progress) isPaused() bool {
func (pr *Progress) snapshotFailure() { pr.PendingSnapshot = 0 }
// maybeSnapshotAbort unsets pendingSnapshot if Match is equal or higher than
// the pendingSnapshot
func (pr *Progress) maybeSnapshotAbort() bool {
// needSnapshotAbort returns true if snapshot progress's Match
// is equal or higher than the pendingSnapshot.
func (pr *Progress) needSnapshotAbort() bool {
return pr.State == ProgressStateSnapshot && pr.Match >= pr.PendingSnapshot
}

View File

@ -670,7 +670,7 @@ func stepLeader(r *raft, m pb.Message) {
switch {
case pr.State == ProgressStateProbe:
pr.becomeReplicate()
case pr.State == ProgressStateSnapshot && pr.maybeSnapshotAbort():
case pr.State == ProgressStateSnapshot && pr.needSnapshotAbort():
r.logger.Debugf("%x snapshot aborted, resumed sending replication messages to %x [%s]", r.id, m.From, pr)
pr.becomeProbe()
case pr.State == ProgressStateReplicate: