Skip to content

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.

fix(mount): fall through to filer when cached dir misses a tracked inode (#9436)

Chris Lu6d12ebeefea1
diff --git a/weed/mount/weedfs.go b/weed/mount/weedfs.go
index 9b4953e481..6c50ac04a5 100644
--- a/weed/mount/weedfs.go
+++ b/weed/mount/weedfs.go
@@ -583,16 +583,15 @@ func (wfs *WFS) lookupEntry(fullpath util.FullPath) (*filer.Entry, fuse.Status)
// our IsDirectoryCached check and FindEntry (e.g. markDirectoryReadThrough).
// If it's no longer cached, fall through to the filer lookup below.
if wfs.metaCache.IsDirectoryCached(dirPath) {
- // If the kernel is still tracking this path's inode, the entry
- // was known to exist recently; a cached-dir miss here suggests
- // metaCache/parent-cache coherence drift. Log visibly so the
- // next occurrence shows up in mount.log without -v=4.
- if _, inodeFound := wfs.inodeToPath.GetInode(fullpath); inodeFound {
- glog.Warningf("lookupEntry: %s missing from cache while parent %s is cached; inode still tracked (possible coherence bug)", fullpath, dirPath)
- } else {
+ // Authoritative ENOENT only if inodeToPath also has no record.
+ // If the kernel still tracks this inode, the three layers
+ // disagree; trust the filer over the local cache (the
+ // filer-ErrNotFound branch below logs the confirmed drift).
+ if _, inodeFound := wfs.inodeToPath.GetInode(fullpath); !inodeFound {
glog.V(4).Infof("lookupEntry cache miss (dir cached) %s", fullpath)
+ return nil, fuse.ENOENT
}
- return nil, fuse.ENOENT
+ glog.V(2).Infof("lookupEntry: %s missing from cache while parent %s is cached; inode tracked, consulting filer", fullpath, dirPath)
}
}