Browse Source
Merge pull request #2289 from nivekuil/mountfix
mount: fix consistency issue, invalidate mount meta cache more aggressively
pull/2293/head
Chris Lu
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
4 additions and
8 deletions
-
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 { |
|
|
|