aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-07-12 17:32:19 -0700
committerChris Lu <chris.lu@gmail.com>2020-07-12 17:32:19 -0700
commit4eecc6abc6481746e105210c6f328f2b0414c3eb (patch)
treea006de28677aa6599dbfda43ee5b7d65f59144d5
parent1dd2c7653289b288244010e2cb7f4cb918363686 (diff)
downloadseaweedfs-4eecc6abc6481746e105210c6f328f2b0414c3eb.tar.xz
seaweedfs-4eecc6abc6481746e105210c6f328f2b0414c3eb.zip
filer: emit metadata notification correctly for batch deletion
-rw-r--r--weed/filer2/filer_delete_entry.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/weed/filer2/filer_delete_entry.go b/weed/filer2/filer_delete_entry.go
index f30e10d59..0cc5a655c 100644
--- a/weed/filer2/filer_delete_entry.go
+++ b/weed/filer2/filer_delete_entry.go
@@ -74,9 +74,9 @@ func (f *Filer) doBatchDeleteFolderMetaAndData(ctx context.Context, entry *Entry
if sub.IsDirectory() {
dirChunks, err = f.doBatchDeleteFolderMetaAndData(ctx, sub, isRecursive, ignoreRecursiveError, shouldDeleteChunks, false)
f.cacheDelDirectory(string(sub.FullPath))
- f.NotifyUpdateEvent(ctx, sub, nil, shouldDeleteChunks, isFromOtherCluster)
chunks = append(chunks, dirChunks...)
} else {
+ f.NotifyUpdateEvent(ctx, sub, nil, shouldDeleteChunks, isFromOtherCluster)
chunks = append(chunks, sub.Chunks...)
}
if err != nil && !ignoreRecursiveError {
@@ -95,6 +95,8 @@ func (f *Filer) doBatchDeleteFolderMetaAndData(ctx context.Context, entry *Entry
return nil, fmt.Errorf("filer store delete: %v", storeDeletionErr)
}
+ f.NotifyUpdateEvent(ctx, entry, nil, shouldDeleteChunks, isFromOtherCluster)
+
return chunks, nil
}
@@ -107,8 +109,9 @@ func (f *Filer) doDeleteEntryMetaAndData(ctx context.Context, entry *Entry, shou
}
if entry.IsDirectory() {
f.cacheDelDirectory(string(entry.FullPath))
+ } else {
+ f.NotifyUpdateEvent(ctx, entry, nil, shouldDeleteChunks, isFromOtherCluster)
}
- f.NotifyUpdateEvent(ctx, entry, nil, shouldDeleteChunks, isFromOtherCluster)
return nil
}