mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
snap: call fsync before close db file
This commit is contained in:
parent
289de69632
commit
191c5ef9cb
@ -32,6 +32,9 @@ func (s *Snapshotter) SaveDBFrom(r io.Reader, id uint64) error {
|
||||
return err
|
||||
}
|
||||
_, err = io.Copy(f, r)
|
||||
if err == nil {
|
||||
err = f.Sync()
|
||||
}
|
||||
f.Close()
|
||||
if err != nil {
|
||||
os.Remove(f.Name())
|
||||
|
Loading…
x
Reference in New Issue
Block a user