SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
remove all bucket metadata
Chris Lu9357911a9513
diff --git a/weed/filer/abstract_sql/abstract_sql_store.go b/weed/filer/abstract_sql/abstract_sql_store.goindex ab8f6bcbd8..bb8ced81ae 100644--- a/weed/filer/abstract_sql/abstract_sql_store.go+++ b/weed/filer/abstract_sql/abstract_sql_store.go@@ -32,6 +32,9 @@ type AbstractSqlStore struct {dbsLock sync.Mutex}+func (store *AbstractSqlStore) CanDropWholeBucket() bool {+ return store.SupportBucketTable+}func (store *AbstractSqlStore) OnBucketCreation(bucket string) {store.dbsLock.Lock()defer store.dbsLock.Unlock()diff --git a/weed/filer/filer_delete_entry.go b/weed/filer/filer_delete_entry.goindex 3ef3cfff91..35187d034d 100644--- a/weed/filer/filer_delete_entry.go+++ b/weed/filer/filer_delete_entry.go@@ -71,7 +71,7 @@ func (f *Filer) doBatchDeleteFolderMetaAndData(ctx context.Context, entry *EntrylastFileName := ""includeLastFile := false- if !isDeletingBucket {+ if !isDeletingBucket || !f.Store.CanDropWholeBucket() {for {entries, _, err := f.ListDirectoryEntries(ctx, entry.FullPath, lastFileName, includeLastFile, PaginationSize, "", "", "")if err != nil {diff --git a/weed/filer/filerstore.go b/weed/filer/filerstore.goindex a5b2f25de0..1ded11b4a6 100644--- a/weed/filer/filerstore.go+++ b/weed/filer/filerstore.go@@ -43,4 +43,5 @@ type FilerStore interface {type BucketAware interface {OnBucketCreation(bucket string)OnBucketDeletion(bucket string)+ IsDropBucketAltogether() bool}diff --git a/weed/filer/filerstore_wrapper.go b/weed/filer/filerstore_wrapper.goindex 5175a87a18..e4761f5653 100644--- a/weed/filer/filerstore_wrapper.go+++ b/weed/filer/filerstore_wrapper.go@@ -23,6 +23,7 @@ type VirtualFilerStore interface {AddPathSpecificStore(path string, storeId string, store FilerStore)OnBucketCreation(bucket string)OnBucketDeletion(bucket string)+ CanDropWholeBucket() bool}type FilerStoreWrapper struct {@@ -42,6 +43,13 @@ func NewFilerStoreWrapper(store FilerStore) *FilerStoreWrapper {}}+func (fsw *FilerStoreWrapper) CanDropWholeBucket() bool {+ if ba, ok := fsw.defaultStore.(BucketAware); ok {+ return ba.IsDropBucketAltogether()+ }+ return false+}+func (fsw *FilerStoreWrapper) OnBucketCreation(bucket string) {for _, store := range fsw.storeIdToStore {if ba, ok := store.(BucketAware); ok {