aboutsummaryrefslogtreecommitdiff
path: root/weed/filesys/filehandle.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-04-22 15:40:47 -0700
committerChris Lu <chris.lu@gmail.com>2020-04-22 15:40:47 -0700
commit5d0e1d8d741b93c8f77b6ff709b5079580c7dda6 (patch)
tree1353af891f287a2878c34c5c1c63ec07f136a672 /weed/filesys/filehandle.go
parent1a34fd0b44f5379e419aada1785e9d7e4f8fcc6b (diff)
downloadseaweedfs-5d0e1d8d741b93c8f77b6ff709b5079580c7dda6.tar.xz
seaweedfs-5d0e1d8d741b93c8f77b6ff709b5079580c7dda6.zip
also writes to local meta cache
before waiting for subscribed meta events
Diffstat (limited to 'weed/filesys/filehandle.go')
-rw-r--r--weed/filesys/filehandle.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/weed/filesys/filehandle.go b/weed/filesys/filehandle.go
index d2983d53f..372d742ea 100644
--- a/weed/filesys/filehandle.go
+++ b/weed/filesys/filehandle.go
@@ -209,6 +209,10 @@ func (fh *FileHandle) Flush(ctx context.Context, req *fuse.FlushRequest) error {
return fmt.Errorf("fh flush create %s: %v", fh.f.fullpath(), err)
}
+ if fh.f.wfs.option.AsyncMetaDataCaching {
+ fh.f.wfs.metaCache.InsertEntry(context.Background(), filer2.FromPbEntry(request.Directory, request.Entry))
+ }
+
fh.f.wfs.deleteFileChunks(garbages)
for i, chunk := range garbages {
glog.V(3).Infof("garbage %s chunks %d: %v [%d,%d)", fh.f.fullpath(), i, chunk.FileId, chunk.Offset, chunk.Offset+int64(chunk.Size))