treat 0-byte objects to honor same quorum as delete marker (#17633)

on unversioned buckets its possible that 0-byte objects
might lose quorum on flaky systems, allow them to be same
as DELETE markers. Since practically speak they have no
content.
This commit is contained in:
Harshavardhana
2023-07-11 21:53:49 -07:00
committed by GitHub
parent f6040dffaf
commit a566bcf613
4 changed files with 13 additions and 7 deletions

View File

@@ -278,6 +278,11 @@ func (er erasureObjects) GetObjectNInfo(ctx context.Context, bucket, object stri
return gr.WithCleanupFuncs(nsUnlocker), nil
}
if objInfo.Size == 0 {
// Zero byte objects don't even need to further initialize pipes etc.
return NewGetObjectReaderFromReader(bytes.NewReader(nil), objInfo, opts)
}
fn, off, length, err := NewGetObjectReader(rs, objInfo, opts)
if err != nil {
return nil, err