mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-11-07 04:27:49 +01:00
sync before closing index file
merge from https://github.com/stlpmo-jn/seaweedfs/commit/0181f87d9142852f981541cb05689df9fc9ef6a0
This commit is contained in:
1 parent
3a35632d58
commit
08e4702542
1 file changed
+4
@@ -64,6 +64,10 @@ func (nm *NeedleMap) Delete(key NeedleId, offset Offset) error {
|
||||
return nm.appendToIndexFile(key, offset, TombstoneFileSize)
|
||||
}
|
||||
func (nm *NeedleMap) Close() {
|
||||
indexFileName := nm.indexFile.Name()
|
||||
if err := nm.indexFile.Sync(); err != nil {
|
||||
glog.Warningf("sync file %s failed, %v", indexFileName, err)
|
||||
}
|
||||
_ = nm.indexFile.Close()
|
||||
}
|
||||
func (nm *NeedleMap) Destroy() error {
|
||||
|
||||
Reference in new issue
Block a user