mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
delete chunks in the last step
This commit is contained in:
parent
99d05f758c
commit
9f1e0aeef5
|
@ -317,8 +317,8 @@ func (dir *Dir) removeOneFile(req *fuse.RemoveRequest) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
dir.wfs.deleteFileChunks(entry.Chunks)
|
|
||||||
|
|
||||||
|
// first, ensure the filer store can correctly delete
|
||||||
glog.V(3).Infof("remove file: %v", req)
|
glog.V(3).Infof("remove file: %v", req)
|
||||||
err = filer_pb.Remove(dir.wfs, dir.FullPath(), req.Name, false, false, false, false)
|
err = filer_pb.Remove(dir.wfs, dir.FullPath(), req.Name, false, false, false, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -326,9 +326,13 @@ func (dir *Dir) removeOneFile(req *fuse.RemoveRequest) error {
|
||||||
return fuse.ENOENT
|
return fuse.ENOENT
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// then, delete meta cache and fsNode cache
|
||||||
dir.wfs.metaCache.DeleteEntry(context.Background(), filePath)
|
dir.wfs.metaCache.DeleteEntry(context.Background(), filePath)
|
||||||
dir.wfs.fsNodeCache.DeleteFsNode(filePath)
|
dir.wfs.fsNodeCache.DeleteFsNode(filePath)
|
||||||
|
|
||||||
|
// delete the chunks last
|
||||||
|
dir.wfs.deleteFileChunks(entry.Chunks)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue