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.

[mount] fix metacache update (#4161)

wusongde081c0d6446
diff --git a/weed/mount/meta_cache/meta_cache.go b/weed/mount/meta_cache/meta_cache.go
index cb25218242..4ec41a2a87 100644
--- a/weed/mount/meta_cache/meta_cache.go
+++ b/weed/mount/meta_cache/meta_cache.go
@@ -70,8 +70,12 @@ func (mc *MetaCache) AtomicUpdateEntryFromFiler(ctx context.Context, oldPath uti
//mc.Lock()
//defer mc.Unlock()
- oldDir, _ := oldPath.DirAndName()
- if mc.isCachedFn(util.FullPath(oldDir)) {
+ entry, err := mc.FindEntry(ctx, oldPath)
+ if err != nil && err != filer_pb.ErrNotFound {
+ glog.Errorf("Metacache: find entry error: %v", err)
+ return err
+ }
+ if entry != nil {
if oldPath != "" {
if newEntry != nil && oldPath == newEntry.FullPath {
// skip the unnecessary deletion