From ce6cef68557f802472333d5837ca7a64c2a085d6 Mon Sep 17 00:00:00 2001 From: Anis Elleuch Date: Thu, 10 Sep 2020 17:27:52 +0100 Subject: [PATCH] erasure: Call Walk() from all disks (#10445) It does not make sense to call Walk() in only N/2 disks and then requires N/2 quorum, just keep it N/2+1 The commit fixes this behavior. --- cmd/erasure-common.go | 4 +++- cmd/erasure-zones.go | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cmd/erasure-common.go b/cmd/erasure-common.go index bf84c4914..eda68feb4 100644 --- a/cmd/erasure-common.go +++ b/cmd/erasure-common.go @@ -34,7 +34,9 @@ func (er erasureObjects) getLoadBalancedLocalDisks() (newDisks []StorageAPI) { return newDisks } -// getLoadBalancedNDisks - fetches load balanced (sufficiently randomized) disk slice with N disks online +// getLoadBalancedNDisks - fetches load balanced (sufficiently randomized) disk slice +// with N disks online. If ndisks is zero or negative, then it will returns all disks, +// same if ndisks is greater than the number of all disks. func (er erasureObjects) getLoadBalancedNDisks(ndisks int) (newDisks []StorageAPI) { disks := er.getLoadBalancedDisks() for _, disk := range disks { diff --git a/cmd/erasure-zones.go b/cmd/erasure-zones.go index 20925920c..868c04c86 100644 --- a/cmd/erasure-zones.go +++ b/cmd/erasure-zones.go @@ -911,7 +911,7 @@ func (z *erasureZones) listObjects(ctx context.Context, bucket, prefix, marker, entryChs, endWalkCh := zone.pool.Release(listParams{bucket, recursive, marker, prefix}) if entryChs == nil { endWalkCh = make(chan struct{}) - entryChs = zone.startMergeWalksN(ctx, bucket, prefix, marker, recursive, endWalkCh, zone.listTolerancePerSet, false) + entryChs = zone.startMergeWalksN(ctx, bucket, prefix, marker, recursive, endWalkCh, zone.listTolerancePerSet+1, false) } zonesEntryChs = append(zonesEntryChs, entryChs) zonesEndWalkCh = append(zonesEndWalkCh, endWalkCh) @@ -1280,7 +1280,7 @@ func (z *erasureZones) listObjectVersions(ctx context.Context, bucket, prefix, m entryChs, endWalkCh := zone.poolVersions.Release(listParams{bucket, recursive, marker, prefix}) if entryChs == nil { endWalkCh = make(chan struct{}) - entryChs = zone.startMergeWalksVersionsN(ctx, bucket, prefix, marker, recursive, endWalkCh, zone.listTolerancePerSet) + entryChs = zone.startMergeWalksVersionsN(ctx, bucket, prefix, marker, recursive, endWalkCh, zone.listTolerancePerSet+1) } zonesEntryChs = append(zonesEntryChs, entryChs) zonesEndWalkCh = append(zonesEndWalkCh, endWalkCh)