Browse Source

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

Xiang Li 11 years ago
parent
commit
28f87c2a43
1 changed files with 1 additions and 1 deletions
  1. 1 1
      raft/raft.go

+ 1 - 1
raft/raft.go

@@ -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")