etcdserver: commit before sending snapshot
This commit is contained in:
@ -1170,8 +1170,7 @@ func (s *EtcdServer) snapshot(snapi uint64, confState raftpb.ConfState) {
|
|||||||
}
|
}
|
||||||
plog.Panicf("unexpected create snapshot error %v", err)
|
plog.Panicf("unexpected create snapshot error %v", err)
|
||||||
}
|
}
|
||||||
// commit v3 storage because WAL file before snapshot index
|
// commit kv to write metadata (for example: consistent index) to disk.
|
||||||
// could be removed after SaveSnap.
|
|
||||||
s.KV().Commit()
|
s.KV().Commit()
|
||||||
// SaveSnap saves the snapshot and releases the locked wal files
|
// SaveSnap saves the snapshot and releases the locked wal files
|
||||||
// to the snapshot index.
|
// to the snapshot index.
|
||||||
|
@ -39,6 +39,8 @@ func (s *EtcdServer) createMergedSnapshotMessage(m raftpb.Message, snapi uint64,
|
|||||||
plog.Panicf("store save should never fail: %v", err)
|
plog.Panicf("store save should never fail: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// commit kv to write metadata(for example: consistent index).
|
||||||
|
s.KV().Commit()
|
||||||
dbsnap := s.be.Snapshot()
|
dbsnap := s.be.Snapshot()
|
||||||
// get a snapshot of v3 KV as readCloser
|
// get a snapshot of v3 KV as readCloser
|
||||||
rc := newSnapshotReaderCloser(dbsnap)
|
rc := newSnapshotReaderCloser(dbsnap)
|
||||||
|
Reference in New Issue
Block a user