Skip to content

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.

fixed the problem of empty directory when S3 deleted the directory

limd1892677b2218
diff --git a/weed/s3api/s3api_object_handlers.go b/weed/s3api/s3api_object_handlers.go
index cb85aa9fef..9947265654 100644
--- a/weed/s3api/s3api_object_handlers.go
+++ b/weed/s3api/s3api_object_handlers.go
@@ -183,6 +183,11 @@ func (s3a *S3ApiServer) DeleteMultipleObjectsHandler(w http.ResponseWriter, r *h
s3a.WithFilerClient(func(client filer_pb.SeaweedFilerClient) error {
for _, object := range deleteObjects.Objects {
+ response, _ := s3a.listFilerEntries(bucket, object.ObjectName, 1, "", "/")
+ if len(response.Contents) != 0 && strings.HasSuffix(object.ObjectName, "/") {
+ continue
+ }
+
lastSeparator := strings.LastIndex(object.ObjectName, "/")
parentDirectoryPath, entryName, isDeleteData, isRecursive := "/", object.ObjectName, true, true
if lastSeparator > 0 && lastSeparator+1 < len(object.ObjectName) {