diff --git a/raft/log.go b/raft/log.go index 169fdf75a..e3222011d 100644 --- a/raft/log.go +++ b/raft/log.go @@ -30,7 +30,7 @@ func (l *log) maybeAppend(index, logTerm, commit int, ents ...Entry) bool { func (l *log) append(after int, ents ...Entry) int { l.ents = append(l.ents[:after+1], ents...) - return len(l.ents) - 1 + return l.lastIndex() } func (l *log) lastIndex() int {