mirror of
https://github.com/minio/minio.git
synced 2025-01-11 15:03:22 -05:00
parent
72743d1590
commit
85a1956e5c
@ -26,6 +26,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/minio/minio-go/v6/pkg/set"
|
||||
"github.com/minio/minio-go/v6/pkg/tags"
|
||||
"github.com/minio/minio/cmd/config/storageclass"
|
||||
xhttp "github.com/minio/minio/cmd/http"
|
||||
@ -542,14 +543,14 @@ func (z *erasureZones) DeleteObject(ctx context.Context, bucket string, object s
|
||||
func (z *erasureZones) DeleteObjects(ctx context.Context, bucket string, objects []ObjectToDelete, opts ObjectOptions) ([]DeletedObject, []error) {
|
||||
derrs := make([]error, len(objects))
|
||||
dobjects := make([]DeletedObject, len(objects))
|
||||
objNames := make([]string, len(objects))
|
||||
objSets := set.NewStringSet()
|
||||
for i := range derrs {
|
||||
derrs[i] = checkDelObjArgs(ctx, bucket, objects[i].ObjectName)
|
||||
objNames[i] = objects[i].ObjectName
|
||||
objSets.Add(objects[i].ObjectName)
|
||||
}
|
||||
|
||||
// Acquire a bulk write lock across 'objects'
|
||||
multiDeleteLock := z.NewNSLock(ctx, bucket, objNames...)
|
||||
multiDeleteLock := z.NewNSLock(ctx, bucket, objSets.ToSlice()...)
|
||||
if err := multiDeleteLock.GetLock(globalOperationTimeout); err != nil {
|
||||
for i := range derrs {
|
||||
derrs[i] = err
|
||||
|
@ -1181,7 +1181,11 @@ func (fs *FSObjects) DeleteObjects(ctx context.Context, bucket string, objects [
|
||||
dobjects := make([]DeletedObject, len(objects))
|
||||
for idx, object := range objects {
|
||||
if object.VersionID != "" {
|
||||
errs[idx] = NotImplemented{}
|
||||
errs[idx] = VersionNotFound{
|
||||
Bucket: bucket,
|
||||
Object: object.ObjectName,
|
||||
VersionID: object.VersionID,
|
||||
}
|
||||
continue
|
||||
}
|
||||
_, errs[idx] = fs.DeleteObject(ctx, bucket, object.ObjectName, opts)
|
||||
|
Loading…
Reference in New Issue
Block a user