From 223c1b3571dedd4d2a549ead9e29bc4aed3b39db Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sat, 28 Aug 2021 05:21:01 -0700 Subject: [PATCH] adjust invalidation logic --- weed/filesys/meta_cache/meta_cache_subscribe.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/weed/filesys/meta_cache/meta_cache_subscribe.go b/weed/filesys/meta_cache/meta_cache_subscribe.go index 60e9d0c13..2099cf1f8 100644 --- a/weed/filesys/meta_cache/meta_cache_subscribe.go +++ b/weed/filesys/meta_cache/meta_cache_subscribe.go @@ -41,8 +41,10 @@ func SubscribeMetaEvents(mc *MetaCache, selfSignature int32, client filer_pb.Fil if message.OldEntry != nil && message.NewEntry != nil { oldKey := util.NewFullPath(resp.Directory, message.OldEntry.Name) mc.invalidateFunc(oldKey) - newKey := util.NewFullPath(dir, message.NewEntry.Name) - mc.invalidateFunc(newKey) + if message.OldEntry.Name != message.NewEntry.Name { + 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 {