fix: dangling delete() upon success should return 404 (#16494)

This commit is contained in:
Harshavardhana 2023-01-28 02:13:45 +05:30 committed by GitHub
parent eaa65b7ade
commit 67fce4a5b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -636,7 +636,10 @@ func (er erasureObjects) getObjectFileInfo(ctx context.Context, bucket, object s
if reducedErr := reduceReadQuorumErrs(ctx, errs, objectOpIgnoredErrs, readQuorum); reducedErr != nil {
if errors.Is(reducedErr, errErasureReadQuorum) && !strings.HasPrefix(bucket, minioMetaBucket) {
er.deleteIfDangling(ctx, bucket, object, metaArr, errs, nil, opts)
_, derr := er.deleteIfDangling(ctx, bucket, object, metaArr, errs, nil, opts)
if derr != nil {
reducedErr = derr
}
}
return fi, nil, nil, toObjectErr(reducedErr, bucket, object)
}