mirror of
https://github.com/minio/minio.git
synced 2025-04-20 10:37:31 -04:00
parent
72743d1590
commit
85a1956e5c
@ -26,6 +26,7 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/minio/minio-go/v6/pkg/set"
|
||||||
"github.com/minio/minio-go/v6/pkg/tags"
|
"github.com/minio/minio-go/v6/pkg/tags"
|
||||||
"github.com/minio/minio/cmd/config/storageclass"
|
"github.com/minio/minio/cmd/config/storageclass"
|
||||||
xhttp "github.com/minio/minio/cmd/http"
|
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) {
|
func (z *erasureZones) DeleteObjects(ctx context.Context, bucket string, objects []ObjectToDelete, opts ObjectOptions) ([]DeletedObject, []error) {
|
||||||
derrs := make([]error, len(objects))
|
derrs := make([]error, len(objects))
|
||||||
dobjects := make([]DeletedObject, len(objects))
|
dobjects := make([]DeletedObject, len(objects))
|
||||||
objNames := make([]string, len(objects))
|
objSets := set.NewStringSet()
|
||||||
for i := range derrs {
|
for i := range derrs {
|
||||||
derrs[i] = checkDelObjArgs(ctx, bucket, objects[i].ObjectName)
|
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'
|
// 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 {
|
if err := multiDeleteLock.GetLock(globalOperationTimeout); err != nil {
|
||||||
for i := range derrs {
|
for i := range derrs {
|
||||||
derrs[i] = err
|
derrs[i] = err
|
||||||
|
@ -1181,7 +1181,11 @@ func (fs *FSObjects) DeleteObjects(ctx context.Context, bucket string, objects [
|
|||||||
dobjects := make([]DeletedObject, len(objects))
|
dobjects := make([]DeletedObject, len(objects))
|
||||||
for idx, object := range objects {
|
for idx, object := range objects {
|
||||||
if object.VersionID != "" {
|
if object.VersionID != "" {
|
||||||
errs[idx] = NotImplemented{}
|
errs[idx] = VersionNotFound{
|
||||||
|
Bucket: bucket,
|
||||||
|
Object: object.ObjectName,
|
||||||
|
VersionID: object.VersionID,
|
||||||
|
}
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
_, errs[idx] = fs.DeleteObject(ctx, bucket, object.ObjectName, opts)
|
_, errs[idx] = fs.DeleteObject(ctx, bucket, object.ObjectName, opts)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user