From 8317557f7097a0e41634031a7d4288504f1ac9ef Mon Sep 17 00:00:00 2001 From: Anis Eleuch Date: Fri, 17 Nov 2023 21:09:09 -0800 Subject: [PATCH] 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 --- cmd/erasure-server-pool-decom.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cmd/erasure-server-pool-decom.go b/cmd/erasure-server-pool-decom.go index 763b29ada..20b07b1de 100644 --- a/cmd/erasure-server-pool-decom.go +++ b/cmd/erasure-server-pool-decom.go @@ -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()) } + listQuorum := (len(disks) + 1) / 2 + // How to resolve partial results. resolver := metadataResolutionParams{ - dirQuorum: len(disks) / 2, // make sure to capture all quorum ratios - objQuorum: len(disks) / 2, // make sure to capture all quorum ratios + dirQuorum: listQuorum, // make sure to capture all quorum ratios + objQuorum: listQuorum, // make sure to capture all quorum ratios bucket: bi.Name, } @@ -714,7 +716,7 @@ func (set *erasureObjects) listObjectsToDecommission(ctx context.Context, bi dec path: bi.Prefix, recursive: true, forwardTo: "", - minDisks: len(disks) / 2, // to capture all quorum ratios + minDisks: len(disks) / 2, reportNotFound: false, agreed: fn, partial: func(entries metaCacheEntries, _ []error) {