mirror of
https://github.com/pgsty/minio.git
synced 2026-08-12 09:40:28 +03:00
XL: Ignore and continue for cases when bucket does not exist. (#2205)
Fixes #2201 Fixes #2204
This commit is contained in:
+33
-8
@@ -333,11 +333,23 @@ func writeUniqueXLMetadata(disks []StorageAPI, bucket, prefix string, xlMetas []
|
||||
return errXLWriteQuorum
|
||||
}
|
||||
|
||||
// For all other errors return.
|
||||
for _, err := range mErrs {
|
||||
if err != nil && err != errDiskNotFound {
|
||||
return err
|
||||
// Reduce errors and verify quourm and return.
|
||||
if errCount, reducedErr := reduceErrs(mErrs); reducedErr != nil {
|
||||
if errCount < writeQuorum {
|
||||
// Delete all `xl.json` successfully renamed.
|
||||
deleteAllXLMetadata(disks, bucket, prefix, mErrs)
|
||||
return errXLWriteQuorum
|
||||
}
|
||||
if isErrIgnored(reducedErr, []error{
|
||||
errDiskNotFound,
|
||||
errDiskAccessDenied,
|
||||
errFaultyDisk,
|
||||
errVolumeNotFound,
|
||||
}) {
|
||||
// Success.
|
||||
return nil
|
||||
}
|
||||
return reducedErr
|
||||
}
|
||||
|
||||
// Success.
|
||||
@@ -386,11 +398,24 @@ func writeSameXLMetadata(disks []StorageAPI, bucket, prefix string, xlMeta xlMet
|
||||
return errXLWriteQuorum
|
||||
}
|
||||
|
||||
// For any other errors delete `xl.json` as well.
|
||||
for _, err := range mErrs {
|
||||
if err != nil && err != errDiskNotFound {
|
||||
return err
|
||||
// Reduce errors and verify quourm and return.
|
||||
if errCount, reducedErr := reduceErrs(mErrs); reducedErr != nil {
|
||||
if errCount < writeQuorum {
|
||||
// Delete all `xl.json` successfully renamed.
|
||||
deleteAllXLMetadata(disks, bucket, prefix, mErrs)
|
||||
return errXLWriteQuorum
|
||||
}
|
||||
// Ignore specific errors if we are under write quorum.
|
||||
if isErrIgnored(reducedErr, []error{
|
||||
errDiskNotFound,
|
||||
errDiskAccessDenied,
|
||||
errFaultyDisk,
|
||||
errVolumeNotFound,
|
||||
}) {
|
||||
// Success.
|
||||
return nil
|
||||
}
|
||||
return reducedErr
|
||||
}
|
||||
|
||||
// Success.
|
||||
|
||||
Reference in New Issue
Block a user