mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #9282 from gyuho/raft-index
raft: reuse "last index" in "appendEntry"
This commit is contained in:
commit
af44780be1
@ -604,8 +604,9 @@ func (r *raft) appendEntry(es ...pb.Entry) {
|
||||
es[i].Term = r.Term
|
||||
es[i].Index = li + 1 + uint64(i)
|
||||
}
|
||||
r.raftLog.append(es...)
|
||||
r.getProgress(r.id).maybeUpdate(r.raftLog.lastIndex())
|
||||
// use latest "last" index after truncate/append
|
||||
li = r.raftLog.append(es...)
|
||||
r.getProgress(r.id).maybeUpdate(li)
|
||||
// Regardless of maybeCommit's return, our caller will call bcastAppend.
|
||||
r.maybeCommit()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user