|
|
@ -684,8 +684,12 @@ func (z *erasureZones) listObjectsNonSlash(ctx context.Context, bucket, prefix, |
|
|
|
for _, zone := range z.zones { |
|
|
|
for _, zone := range z.zones { |
|
|
|
zonesEntryChs = append(zonesEntryChs, |
|
|
|
zonesEntryChs = append(zonesEntryChs, |
|
|
|
zone.startMergeWalksN(ctx, bucket, prefix, "", true, endWalkCh, zone.listTolerancePerSet, false)) |
|
|
|
zone.startMergeWalksN(ctx, bucket, prefix, "", true, endWalkCh, zone.listTolerancePerSet, false)) |
|
|
|
|
|
|
|
if zone.listTolerancePerSet == -1 { |
|
|
|
|
|
|
|
zonesListTolerancePerSet = append(zonesListTolerancePerSet, zone.setDriveCount/2) |
|
|
|
|
|
|
|
} else { |
|
|
|
zonesListTolerancePerSet = append(zonesListTolerancePerSet, zone.listTolerancePerSet-2) |
|
|
|
zonesListTolerancePerSet = append(zonesListTolerancePerSet, zone.listTolerancePerSet-2) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var objInfos []ObjectInfo |
|
|
|
var objInfos []ObjectInfo |
|
|
|
var eof bool |
|
|
|
var eof bool |
|
|
@ -710,7 +714,7 @@ func (z *erasureZones) listObjectsNonSlash(ctx context.Context, bucket, prefix, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if quorumCount < zonesListTolerancePerSet[zoneIndex] { |
|
|
|
if quorumCount < zonesListTolerancePerSet[zoneIndex] { |
|
|
|
// Skip entries which are not found on upto ndisks/2.
|
|
|
|
// Skip entries which are not found on upto expected tolerance
|
|
|
|
continue |
|
|
|
continue |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -806,8 +810,12 @@ func (z *erasureZones) listObjectsSplunk(ctx context.Context, bucket, prefix, ma |
|
|
|
} |
|
|
|
} |
|
|
|
zonesEntryChs = append(zonesEntryChs, entryChs) |
|
|
|
zonesEntryChs = append(zonesEntryChs, entryChs) |
|
|
|
zonesEndWalkCh = append(zonesEndWalkCh, endWalkCh) |
|
|
|
zonesEndWalkCh = append(zonesEndWalkCh, endWalkCh) |
|
|
|
|
|
|
|
if zone.listTolerancePerSet == -1 { |
|
|
|
|
|
|
|
zonesListTolerancePerSet = append(zonesListTolerancePerSet, zone.setDriveCount/2) |
|
|
|
|
|
|
|
} else { |
|
|
|
zonesListTolerancePerSet = append(zonesListTolerancePerSet, zone.listTolerancePerSet-2) |
|
|
|
zonesListTolerancePerSet = append(zonesListTolerancePerSet, zone.listTolerancePerSet-2) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
entries := mergeZonesEntriesCh(zonesEntryChs, maxKeys, zonesListTolerancePerSet) |
|
|
|
entries := mergeZonesEntriesCh(zonesEntryChs, maxKeys, zonesListTolerancePerSet) |
|
|
|
if len(entries.Files) == 0 { |
|
|
|
if len(entries.Files) == 0 { |
|
|
@ -898,8 +906,12 @@ func (z *erasureZones) listObjects(ctx context.Context, bucket, prefix, marker, |
|
|
|
} |
|
|
|
} |
|
|
|
zonesEntryChs = append(zonesEntryChs, entryChs) |
|
|
|
zonesEntryChs = append(zonesEntryChs, entryChs) |
|
|
|
zonesEndWalkCh = append(zonesEndWalkCh, endWalkCh) |
|
|
|
zonesEndWalkCh = append(zonesEndWalkCh, endWalkCh) |
|
|
|
|
|
|
|
if zone.listTolerancePerSet == -1 { |
|
|
|
|
|
|
|
zonesListTolerancePerSet = append(zonesListTolerancePerSet, zone.setDriveCount/2) |
|
|
|
|
|
|
|
} else { |
|
|
|
zonesListTolerancePerSet = append(zonesListTolerancePerSet, zone.listTolerancePerSet-2) |
|
|
|
zonesListTolerancePerSet = append(zonesListTolerancePerSet, zone.listTolerancePerSet-2) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
entries := mergeZonesEntriesCh(zonesEntryChs, maxKeys, zonesListTolerancePerSet) |
|
|
|
entries := mergeZonesEntriesCh(zonesEntryChs, maxKeys, zonesListTolerancePerSet) |
|
|
|
if len(entries.Files) == 0 { |
|
|
|
if len(entries.Files) == 0 { |
|
|
@ -1300,8 +1312,12 @@ func (z *erasureZones) listObjectVersions(ctx context.Context, bucket, prefix, m |
|
|
|
} |
|
|
|
} |
|
|
|
zonesEntryChs = append(zonesEntryChs, entryChs) |
|
|
|
zonesEntryChs = append(zonesEntryChs, entryChs) |
|
|
|
zonesEndWalkCh = append(zonesEndWalkCh, endWalkCh) |
|
|
|
zonesEndWalkCh = append(zonesEndWalkCh, endWalkCh) |
|
|
|
|
|
|
|
if zone.listTolerancePerSet == -1 { |
|
|
|
|
|
|
|
zonesListTolerancePerSet = append(zonesListTolerancePerSet, zone.setDriveCount/2) |
|
|
|
|
|
|
|
} else { |
|
|
|
zonesListTolerancePerSet = append(zonesListTolerancePerSet, zone.listTolerancePerSet-2) |
|
|
|
zonesListTolerancePerSet = append(zonesListTolerancePerSet, zone.listTolerancePerSet-2) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
entries := mergeZonesEntriesVersionsCh(zonesEntryChs, maxKeys, zonesListTolerancePerSet) |
|
|
|
entries := mergeZonesEntriesVersionsCh(zonesEntryChs, maxKeys, zonesListTolerancePerSet) |
|
|
|
if len(entries.FilesVersions) == 0 { |
|
|
|
if len(entries.FilesVersions) == 0 { |
|
|
@ -1772,9 +1788,13 @@ func (z *erasureZones) Walk(ctx context.Context, bucket, prefix string, results |
|
|
|
return err |
|
|
|
return err |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var zoneDrivesPerSet []int |
|
|
|
zonesListTolerancePerSet := make([]int, 0, len(z.zones)) |
|
|
|
for _, zone := range z.zones { |
|
|
|
for _, zone := range z.zones { |
|
|
|
zoneDrivesPerSet = append(zoneDrivesPerSet, zone.listTolerancePerSet-2) |
|
|
|
if zone.listTolerancePerSet == -1 { |
|
|
|
|
|
|
|
zonesListTolerancePerSet = append(zonesListTolerancePerSet, zone.setDriveCount/2) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
zonesListTolerancePerSet = append(zonesListTolerancePerSet, zone.listTolerancePerSet-2) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if opts.WalkVersions { |
|
|
|
if opts.WalkVersions { |
|
|
@ -1794,13 +1814,13 @@ func (z *erasureZones) Walk(ctx context.Context, bucket, prefix string, results |
|
|
|
defer close(results) |
|
|
|
defer close(results) |
|
|
|
|
|
|
|
|
|
|
|
for { |
|
|
|
for { |
|
|
|
entry, quorumCount, _, ok := lexicallySortedEntryZoneVersions(zonesEntryChs, zonesEntriesInfos, zonesEntriesValid) |
|
|
|
entry, quorumCount, zoneIdx, ok := lexicallySortedEntryZoneVersions(zonesEntryChs, zonesEntriesInfos, zonesEntriesValid) |
|
|
|
if !ok { |
|
|
|
if !ok { |
|
|
|
// We have reached EOF across all entryChs, break the loop.
|
|
|
|
// We have reached EOF across all entryChs, break the loop.
|
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if quorumCount > 0 { |
|
|
|
if quorumCount >= zonesListTolerancePerSet[zoneIdx] { |
|
|
|
for _, version := range entry.Versions { |
|
|
|
for _, version := range entry.Versions { |
|
|
|
results <- version.ToObjectInfo(bucket, version.Name) |
|
|
|
results <- version.ToObjectInfo(bucket, version.Name) |
|
|
|
} |
|
|
|
} |
|
|
@ -1827,13 +1847,13 @@ func (z *erasureZones) Walk(ctx context.Context, bucket, prefix string, results |
|
|
|
defer close(results) |
|
|
|
defer close(results) |
|
|
|
|
|
|
|
|
|
|
|
for { |
|
|
|
for { |
|
|
|
entry, quorumCount, _, ok := lexicallySortedEntryZone(zonesEntryChs, zonesEntriesInfos, zonesEntriesValid) |
|
|
|
entry, quorumCount, zoneIdx, ok := lexicallySortedEntryZone(zonesEntryChs, zonesEntriesInfos, zonesEntriesValid) |
|
|
|
if !ok { |
|
|
|
if !ok { |
|
|
|
// We have reached EOF across all entryChs, break the loop.
|
|
|
|
// We have reached EOF across all entryChs, break the loop.
|
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if quorumCount > 0 { |
|
|
|
if quorumCount >= zonesListTolerancePerSet[zoneIdx] { |
|
|
|
results <- entry.ToObjectInfo(bucket, entry.Name) |
|
|
|
results <- entry.ToObjectInfo(bucket, entry.Name) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|