raft: use sm.maybeCommit; should not call log.maybeCommit directly

release-2.0
Xiang Li 2014-06-06 10:25:21 -07:00 committed by Yicheng Qin
parent 4d22ff90d5
commit 28f87c2a43
1 changed files with 1 additions and 1 deletions

View File

@ -259,7 +259,7 @@ func (sm *stateMachine) Step(m Message) {
case sm.addr:
sm.log.append(sm.log.lastIndex(), Entry{Term: sm.term, Data: m.Data})
sm.ins[sm.addr].update(sm.log.lastIndex())
sm.log.maybeCommit(sm.log.lastIndex(), sm.term)
sm.maybeCommit()
sm.bcastAppend()
case none:
panic("msgProp given without leader")