Skip to content

Commit

Permalink
decom: Fix listing quorum to be equal to deletion quorum (minio#18476)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
vadmeste and Anis Elleuch authored Nov 18, 2023
1 parent 1bb7a2a commit 8317557
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cmd/erasure-server-pool-decom.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

Expand All @@ -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) {
Expand Down

0 comments on commit 8317557

Please sign in to comment.