From 8c523d50ad48df30f89f1225d0a2b48e89e1597d Mon Sep 17 00:00:00 2001 From: nivekuil Date: Sat, 28 Aug 2021 04:22:19 -0700 Subject: [PATCH] Invalidate mount meta cache more aggressively --- weed/filesys/meta_cache/meta_cache_subscribe.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/weed/filesys/meta_cache/meta_cache_subscribe.go b/weed/filesys/meta_cache/meta_cache_subscribe.go index 19f5e398a..60e9d0c13 100644 --- a/weed/filesys/meta_cache/meta_cache_subscribe.go +++ b/weed/filesys/meta_cache/meta_cache_subscribe.go @@ -39,14 +39,10 @@ func SubscribeMetaEvents(mc *MetaCache, selfSignature int32, client filer_pb.Fil err := mc.AtomicUpdateEntryFromFiler(context.Background(), oldPath, newEntry) if err == nil { if message.OldEntry != nil && message.NewEntry != nil { - if message.OldEntry.Name == message.NewEntry.Name { - // no need to invalidate - } else { - oldKey := util.NewFullPath(resp.Directory, message.OldEntry.Name) - mc.invalidateFunc(oldKey) - newKey := util.NewFullPath(dir, message.NewEntry.Name) - mc.invalidateFunc(newKey) - } + oldKey := util.NewFullPath(resp.Directory, message.OldEntry.Name) + mc.invalidateFunc(oldKey) + newKey := util.NewFullPath(dir, message.NewEntry.Name) + mc.invalidateFunc(newKey) } else if message.OldEntry == nil && message.NewEntry != nil { // no need to invaalidate } else if message.OldEntry != nil && message.NewEntry == nil {