diff --git a/cmd/batch-expire.go b/cmd/batch-expire.go index e6869d620..7360a76c0 100644 --- a/cmd/batch-expire.go +++ b/cmd/batch-expire.go @@ -428,7 +428,8 @@ func batchObjsForDelete(ctx context.Context, r *BatchJobExpire, ri *batchJobInfo } stopFn := globalBatchJobsMetrics.trace(batchJobMetricExpire, ri.JobID, attempts) _, err := api.DeleteObject(ctx, exp.Bucket, encodeDirObject(exp.Name), ObjectOptions{ - DeletePrefix: true, + DeletePrefix: true, + DeletePrefixObject: true, // use prefix delete on exact object (this is an optimization to avoid fan-out calls) }) if err != nil { stopFn(exp, err) diff --git a/cmd/data-scanner.go b/cmd/data-scanner.go index b96df6a54..6099f29df 100644 --- a/cmd/data-scanner.go +++ b/cmd/data-scanner.go @@ -1221,6 +1221,8 @@ func applyExpiryOnNonTransitionedObjects(ctx context.Context, objLayer ObjectLay if lcEvent.Action.DeleteAll() { opts.DeletePrefix = true + // use prefix delete on exact object (this is an optimization to avoid fan-out calls) + opts.DeletePrefixObject = true } var ( dobj ObjectInfo