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
bug fixed to filer store elastic deleteEntry (#5988)
zouyixiongd8e18a8eb774
diff --git a/weed/filer/elastic/v7/elastic_store.go b/weed/filer/elastic/v7/elastic_store.goindex 7bd34852f4..1832ddb734 100644--- a/weed/filer/elastic/v7/elastic_store.go+++ b/weed/filer/elastic/v7/elastic_store.go@@ -159,8 +159,16 @@ func (store *ElasticStore) FindEntry(ctx context.Context, fullpath weed_util.Fulfunc (store *ElasticStore) DeleteEntry(ctx context.Context, fullpath weed_util.FullPath) (err error) {index := getIndex(fullpath, false)id := weed_util.Md5String([]byte(fullpath))- if strings.Count(string(fullpath), "/") == 1 {- return store.deleteIndex(ctx, index)+ strFullpath := string(fullpath)++ // A top-level subdirectory refers to an Elasticsearch index.+ // If we delete an entry at the top level, we should attempt to delete the corresponding Elasticsearch index.+ if strings.Count(strFullpath, "/") == 1 {+ entry, err2 := store.FindEntry(ctx, fullpath)+ if err2 == nil && entry.IsDirectory() {+ bucketIndex := indexPrefix + strFullpath[1:]+ store.deleteIndex(ctx, bucketIndex)+ }}return store.deleteEntry(ctx, index, id)}