mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-05 02:27:26 +01:00
filer/store_test: check that a bucket drop removes nested entries
A store that reports CanDropWholeBucket gets no recursive walk from the filer, so its DeleteFolderChildren on the bucket has to remove every descendant. With only a direct child in bkt2, a store that deleted the direct children and kept the table passed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
44696f39c6
commit
fb5afb7cf7
1 file changed
+5
-2
@@ -55,7 +55,8 @@ func TestFilerStoreConformance(t *testing.T, store filer.FilerStore) {
|
||||
}
|
||||
insert(t, dir("/buckets"), dir("/buckets/bkt1"), dir("/buckets/bkt2"), dir("/buckets/bkt1/a"), dir("/buckets/bkt1/a/b"),
|
||||
file("/buckets/bkt1/top.txt", 1), file("/buckets/bkt1/a/x.txt", 2), file("/buckets/bkt1/a/b/y.txt", 3),
|
||||
file("/buckets/bkt2/top.txt", 4), dir("/topics"), file("/topics/t.log", 5), file("/root.txt", 6), dir("/buckets/bkt1/order"))
|
||||
file("/buckets/bkt2/top.txt", 4), dir("/buckets/bkt2/sub"), file("/buckets/bkt2/sub/deep.txt", 7),
|
||||
dir("/topics"), file("/topics/t.log", 5), file("/root.txt", 6), dir("/buckets/bkt1/order"))
|
||||
orderNames := []string{"B", "a", "a_b", "a%b", "aXb", "a!b", "z", "~", "é", "日本"}
|
||||
for _, n := range orderNames {
|
||||
insert(t, file("/buckets/bkt1/order/"+n, 1))
|
||||
@@ -203,7 +204,9 @@ func TestFilerStoreConformance(t *testing.T, store filer.FilerStore) {
|
||||
if bucketAware, ok := store.(filer.BucketAware); ok && bucketAware.CanDropWholeBucket() {
|
||||
t.Run("drop bucket", func(t *testing.T) {
|
||||
require.NoError(t, store.DeleteFolderChildren(ctx, "/buckets/bkt2"))
|
||||
notFound(t, "/buckets/bkt2/top.txt")
|
||||
for _, p := range []string{"/buckets/bkt2/top.txt", "/buckets/bkt2/sub", "/buckets/bkt2/sub/deep.txt"} {
|
||||
notFound(t, p)
|
||||
}
|
||||
_, err := store.FindEntry(ctx, "/buckets/bkt1/top.txt")
|
||||
require.NoError(t, err)
|
||||
bucketAware.OnBucketDeletion("bkt2")
|
||||
|
||||
Reference in new issue
Block a user