mirror of https://github.com/minio/minio.git
fix: for delete marked objects choose appropriate parity (#17287)
This commit is contained in:
parent
65cba212e8
commit
d5059840ef
|
@ -448,7 +448,7 @@ func commonParity(parities []int, defaultParityCount int) int {
|
|||
occMap[p]++
|
||||
}
|
||||
|
||||
var maxOcc, commonParity int
|
||||
var maxOcc, cparity int
|
||||
for parity, occ := range occMap {
|
||||
if parity == -1 {
|
||||
// Ignore non defined parity
|
||||
|
@ -468,7 +468,7 @@ func commonParity(parities []int, defaultParityCount int) int {
|
|||
|
||||
if occ > maxOcc {
|
||||
maxOcc = occ
|
||||
commonParity = parity
|
||||
cparity = parity
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -476,7 +476,7 @@ func commonParity(parities []int, defaultParityCount int) int {
|
|||
// Did not found anything useful
|
||||
return -1
|
||||
}
|
||||
return commonParity
|
||||
return cparity
|
||||
}
|
||||
|
||||
func listObjectParities(partsMetadata []FileInfo, errs []error) (parities []int) {
|
||||
|
@ -490,7 +490,9 @@ func listObjectParities(partsMetadata []FileInfo, errs []error) (parities []int)
|
|||
parities[index] = -1
|
||||
continue
|
||||
}
|
||||
if !metadata.Deleted {
|
||||
if metadata.Deleted {
|
||||
parities[index] = len(partsMetadata) / 2
|
||||
} else {
|
||||
parities[index] = metadata.Erasure.ParityBlocks
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue