mirror of
https://github.com/minio/minio.git
synced 2025-01-26 14:13:16 -05:00
decom: Fix listing quorum to be equal to deletion quorum (#18476)
With an odd number of drives per erasure set setup, the write/quorum is the half + 1; however the decommissioning listing will still list those objects and does not consider those as stale. Fix it by using (N+1)/2 formula. Co-authored-by: Anis Elleuch <anis@min.io>
This commit is contained in:
parent
1bb7a2a295
commit
8317557f70
@ -701,10 +701,12 @@ func (set *erasureObjects) listObjectsToDecommission(ctx context.Context, bi dec
|
|||||||
return fmt.Errorf("no online drives found for set with endpoints %s", set.getEndpoints())
|
return fmt.Errorf("no online drives found for set with endpoints %s", set.getEndpoints())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
listQuorum := (len(disks) + 1) / 2
|
||||||
|
|
||||||
// How to resolve partial results.
|
// How to resolve partial results.
|
||||||
resolver := metadataResolutionParams{
|
resolver := metadataResolutionParams{
|
||||||
dirQuorum: len(disks) / 2, // make sure to capture all quorum ratios
|
dirQuorum: listQuorum, // make sure to capture all quorum ratios
|
||||||
objQuorum: len(disks) / 2, // make sure to capture all quorum ratios
|
objQuorum: listQuorum, // make sure to capture all quorum ratios
|
||||||
bucket: bi.Name,
|
bucket: bi.Name,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -714,7 +716,7 @@ func (set *erasureObjects) listObjectsToDecommission(ctx context.Context, bi dec
|
|||||||
path: bi.Prefix,
|
path: bi.Prefix,
|
||||||
recursive: true,
|
recursive: true,
|
||||||
forwardTo: "",
|
forwardTo: "",
|
||||||
minDisks: len(disks) / 2, // to capture all quorum ratios
|
minDisks: len(disks) / 2,
|
||||||
reportNotFound: false,
|
reportNotFound: false,
|
||||||
agreed: fn,
|
agreed: fn,
|
||||||
partial: func(entries metaCacheEntries, _ []error) {
|
partial: func(entries metaCacheEntries, _ []error) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user