mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
fix: dangling objects honor parityBlocks instead of dataBlocks (#19019)
Bonus: do not recreate buckets if NoRecreate is asked.
This commit is contained in:
@@ -961,24 +961,18 @@ func isObjectDangling(metaArr []FileInfo, errs []error, dataErrs []error) (valid
|
||||
return validMeta, notFoundMetaErrs > dataBlocks
|
||||
}
|
||||
|
||||
quorum := validMeta.Erasure.DataBlocks
|
||||
if validMeta.Erasure.DataBlocks == validMeta.Erasure.ParityBlocks {
|
||||
quorum++
|
||||
}
|
||||
|
||||
// TODO: It is possible to replay the object via just single
|
||||
// xl.meta file, considering quorum number of data-dirs are still
|
||||
// present on other drives.
|
||||
//
|
||||
// However this requires a bit of a rewrite, leave this up for
|
||||
// future work.
|
||||
|
||||
if notFoundMetaErrs > 0 && notFoundMetaErrs >= quorum {
|
||||
if notFoundMetaErrs > 0 && notFoundMetaErrs > validMeta.Erasure.ParityBlocks {
|
||||
// All xl.meta is beyond data blocks missing, this is dangling
|
||||
return validMeta, true
|
||||
}
|
||||
|
||||
if !validMeta.IsRemote() && notFoundPartsErrs > 0 && notFoundPartsErrs >= quorum {
|
||||
if !validMeta.IsRemote() && notFoundPartsErrs > 0 && notFoundPartsErrs > validMeta.Erasure.ParityBlocks {
|
||||
// All data-dir is beyond data blocks missing, this is dangling
|
||||
return validMeta, true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user