fix: collect quorum errors for deletePrefix() (#19685)

do not return error for single drive being offline.
This commit is contained in:
Harshavardhana 2024-05-06 22:44:46 -07:00 committed by GitHub
parent 39633a5581
commit 6a15580817
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1808,6 +1808,14 @@ func (er erasureObjects) commitRenameDataDir(ctx context.Context, bucket, object
func (er erasureObjects) deletePrefix(ctx context.Context, bucket, prefix string) error { func (er erasureObjects) deletePrefix(ctx context.Context, bucket, prefix string) error {
disks := er.getDisks() disks := er.getDisks()
// Assume (N/2 + 1) quorum for Delete()
// this is a theoretical assumption such that
// for delete's we do not need to honor storage
// class for objects that have reduced quorum
// due to storage class - this only needs to be honored
// for Read() requests alone that we already do.
writeQuorum := len(disks)/2 + 1
g := errgroup.WithNErrs(len(disks)) g := errgroup.WithNErrs(len(disks))
for index := range disks { for index := range disks {
index := index index := index
@ -1821,12 +1829,9 @@ func (er erasureObjects) deletePrefix(ctx context.Context, bucket, prefix string
}) })
}, index) }, index)
} }
for _, err := range g.Wait() {
if err != nil { // return errors if any during deletion
return err return reduceWriteQuorumErrs(ctx, g.Wait(), objectOpIgnoredErrs, writeQuorum)
}
}
return nil
} }
// DeleteObject - deletes an object, this call doesn't necessary reply // DeleteObject - deletes an object, this call doesn't necessary reply