@ -803,30 +803,22 @@ func (xl xlObjects) doDeleteObjects(ctx context.Context, bucket string, objects
}
}
}
}
// Initialize sync waitgroup.
var wg = & sync . WaitGroup { }
// Initialize list of errors.
// Initialize list of errors.
var opErrs = make ( [ ] error , len ( disks ) )
var opErrs = make ( [ ] error , len ( disks ) )
var delObjErrs = make ( [ ] [ ] error , len ( disks ) )
var delObjErrs = make ( [ ] [ ] error , len ( disks ) )
// Remove objects in bulk for each disk
for index , disk := range disks {
for index , disk := range disks {
if disk == nil {
if disk == nil {
opErrs [ index ] = errDiskNotFound
opErrs [ index ] = errDiskNotFound
continue
continue
}
}
wg . Add ( 1 )
go func ( index int , disk StorageAPI ) {
defer wg . Done ( )
delObjErrs [ index ] , opErrs [ index ] = cleanupObjectsBulk ( ctx , disk , minioMetaTmpBucket , tmpObjs , errs )
delObjErrs [ index ] , opErrs [ index ] = cleanupObjectsBulk ( ctx , disk , minioMetaTmpBucket , tmpObjs , errs )
if opErrs [ index ] == errVolumeNotFound {
if opErrs [ index ] == errVolumeNotFound {
opErrs [ index ] = nil
opErrs [ index ] = nil
}
}
} ( index , disk )
}
}
// Wait for all routines to finish.
wg . Wait ( )
// Return errors if any during deletion
// Return errors if any during deletion
if err := reduceWriteQuorumErrs ( ctx , opErrs , objectOpIgnoredErrs , len ( xl . getDisks ( ) ) / 2 + 1 ) ; err != nil {
if err := reduceWriteQuorumErrs ( ctx , opErrs , objectOpIgnoredErrs , len ( xl . getDisks ( ) ) / 2 + 1 ) ; err != nil {
return nil , err
return nil , err