SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
ensure entry view cache is invalidated
chrislub2acfd75e915
diff --git a/weed/filesys/file.go b/weed/filesys/file.goindex e971aa2e0a..48a024f206 100644--- a/weed/filesys/file.go+++ b/weed/filesys/file.go@@ -140,7 +140,15 @@ func (file *File) Setattr(ctx context.Context, req *fuse.SetattrRequest, resp *f}}}+ // set the new chunks and reset entry cacheentry.Chunks = chunks+ file.wfs.handlesLock.Lock()+ existingHandle, found := file.wfs.handles[file.Id()]+ file.wfs.handlesLock.Unlock()+ if found {+ existingHandle.entryViewCache = nil+ }+}entry.Attributes.Mtime = time.Now().Unix()entry.Attributes.FileSize = req.Sizediff --git a/weed/filesys/filehandle.go b/weed/filesys/filehandle.goindex d3b37a5b9c..86ea208062 100644--- a/weed/filesys/filehandle.go+++ b/weed/filesys/filehandle.go@@ -147,7 +147,7 @@ func (fh *FileHandle) readFromChunks(buff []byte, offset int64) (int64, error) {}var chunkResolveErr error- if true || fh.entryViewCache == nil {+ if fh.entryViewCache == nil {fh.entryViewCache, chunkResolveErr = filer.NonOverlappingVisibleIntervals(fh.f.wfs.LookupFn(), entry.Chunks, 0, math.MaxInt64)if chunkResolveErr != nil {return 0, fmt.Errorf("fail to resolve chunk manifest: %v", chunkResolveErr)