mirror of
https://github.com/minio/minio.git
synced 2024-12-25 06:35:56 -05:00
fix: DeleteBucket for peers() must recreate bucket upon errors (#17079)
This commit is contained in:
parent
fae9000304
commit
b09fe0e50e
@ -273,9 +273,24 @@ func (sys *S3PeerSys) DeleteBucket(ctx context.Context, bucket string, opts Dele
|
||||
errs := g.Wait()
|
||||
errs = append(errs, deleteBucketLocal(ctx, bucket, opts))
|
||||
|
||||
quorum := (len(sys.allPeerClients) / 2) + 1
|
||||
err := reduceWriteQuorumErrs(ctx, errs, bucketOpIgnoredErrs, quorum)
|
||||
return toObjectErr(err, bucket)
|
||||
var errReturn error
|
||||
for _, err := range errs {
|
||||
if errReturn == nil && err != nil {
|
||||
// always return first error
|
||||
errReturn = toObjectErr(err, bucket)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
for _, err := range errs {
|
||||
if err == nil && errReturn != nil {
|
||||
// re-create successful deletes, since we are return an error.
|
||||
sys.MakeBucket(ctx, bucket, MakeBucketOptions{})
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
return errReturn
|
||||
}
|
||||
|
||||
// DeleteBucket deletes bucket on a peer
|
||||
|
Loading…
Reference in New Issue
Block a user