mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Wait until all committed entries are applied
To take a snapshot
This commit is contained in:
parent
cb14cdd774
commit
be2167ebab
@ -340,6 +340,15 @@ func (rc *raftNode) maybeTriggerSnapshot() {
|
||||
return
|
||||
}
|
||||
|
||||
// wait until all committed entries are applied
|
||||
// commitC is synchronous channel, so consumption of the message signals
|
||||
// full application of previous messages
|
||||
select {
|
||||
case rc.commitC <- nil:
|
||||
case <-rc.stopc:
|
||||
return
|
||||
}
|
||||
|
||||
log.Printf("start snapshot [applied index: %d | last snapshot index: %d]", rc.appliedIndex, rc.snapshotIndex)
|
||||
data, err := rc.getSnapshot()
|
||||
if err != nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user