mirror of
https://github.com/minio/minio.git
synced 2024-12-24 22:25:54 -05:00
fix: calculate dataBlocks properly in healing (#12364)
This commit is contained in:
parent
cacdeca8cc
commit
ed4941a5f3
@ -632,15 +632,15 @@ func defaultHealResult(lfi FileInfo, storageDisks []StorageAPI, storageEndpoints
|
|||||||
VersionID: versionID,
|
VersionID: versionID,
|
||||||
DiskCount: len(storageDisks),
|
DiskCount: len(storageDisks),
|
||||||
}
|
}
|
||||||
|
|
||||||
if lfi.IsValid() {
|
if lfi.IsValid() {
|
||||||
result.ObjectSize = lfi.Size
|
result.ObjectSize = lfi.Size
|
||||||
result.ParityBlocks = lfi.Erasure.ParityBlocks
|
result.ParityBlocks = lfi.Erasure.ParityBlocks
|
||||||
result.DataBlocks = lfi.Erasure.DataBlocks
|
|
||||||
} else {
|
} else {
|
||||||
// Default to most common configuration for erasure blocks.
|
// Default to most common configuration for erasure blocks.
|
||||||
result.ParityBlocks = defaultParityCount
|
result.ParityBlocks = defaultParityCount
|
||||||
result.DataBlocks = len(storageDisks) - defaultParityCount
|
|
||||||
}
|
}
|
||||||
|
result.DataBlocks = len(storageDisks) - result.ParityBlocks
|
||||||
|
|
||||||
if errs == nil {
|
if errs == nil {
|
||||||
// No disks related errors are provided, quit
|
// No disks related errors are provided, quit
|
||||||
@ -750,8 +750,13 @@ func (er erasureObjects) purgeObjectDangling(ctx context.Context, bucket, object
|
|||||||
// remove we simply delete it from namespace.
|
// remove we simply delete it from namespace.
|
||||||
m, ok := isObjectDangling(metaArr, errs, dataErrs)
|
m, ok := isObjectDangling(metaArr, errs, dataErrs)
|
||||||
if ok {
|
if ok {
|
||||||
writeQuorum := m.Erasure.DataBlocks
|
parityBlocks := m.Erasure.ParityBlocks
|
||||||
if m.Erasure.DataBlocks == 0 || m.Erasure.DataBlocks == m.Erasure.ParityBlocks {
|
if m.Erasure.ParityBlocks == 0 {
|
||||||
|
parityBlocks = er.defaultParityCount
|
||||||
|
}
|
||||||
|
dataBlocks := len(storageDisks) - parityBlocks
|
||||||
|
writeQuorum := dataBlocks
|
||||||
|
if dataBlocks == parityBlocks {
|
||||||
writeQuorum++
|
writeQuorum++
|
||||||
}
|
}
|
||||||
var err error
|
var err error
|
||||||
|
Loading…
Reference in New Issue
Block a user