|
|
@ -549,6 +549,10 @@ func (er *erasureObjects) streamMetadataParts(ctx context.Context, o listPathOpt |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func (er erasureObjects) SetDriveCount() int { |
|
|
|
|
|
|
|
return er.setDriveCount |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Will return io.EOF if continuing would not yield more results.
|
|
|
|
// Will return io.EOF if continuing would not yield more results.
|
|
|
|
func (er *erasureObjects) listPath(ctx context.Context, o listPathOptions) (entries metaCacheEntriesSorted, err error) { |
|
|
|
func (er *erasureObjects) listPath(ctx context.Context, o listPathOptions) (entries metaCacheEntriesSorted, err error) { |
|
|
|
const debugPrint = false |
|
|
|
const debugPrint = false |
|
|
@ -612,6 +616,14 @@ func (er *erasureObjects) listPath(ctx context.Context, o listPathOptions) (entr |
|
|
|
askDisks = getReadQuorum(er.SetDriveCount()) |
|
|
|
askDisks = getReadQuorum(er.SetDriveCount()) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
listingQuorum := askDisks - 1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Special case: ask all disks if the drive count is 4
|
|
|
|
|
|
|
|
if er.SetDriveCount() == 4 { |
|
|
|
|
|
|
|
askDisks = len(disks) |
|
|
|
|
|
|
|
listingQuorum = 2 |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if len(disks) < askDisks { |
|
|
|
if len(disks) < askDisks { |
|
|
|
err = InsufficientReadQuorum{} |
|
|
|
err = InsufficientReadQuorum{} |
|
|
|
logger.LogIf(ctx, fmt.Errorf("listPath: Insufficient disks, %d of %d needed are available", len(disks), askDisks)) |
|
|
|
logger.LogIf(ctx, fmt.Errorf("listPath: Insufficient disks, %d of %d needed are available", len(disks), askDisks)) |
|
|
@ -715,8 +727,8 @@ func (er *erasureObjects) listPath(ctx context.Context, o listPathOptions) (entr |
|
|
|
|
|
|
|
|
|
|
|
// How to resolve results.
|
|
|
|
// How to resolve results.
|
|
|
|
resolver := metadataResolutionParams{ |
|
|
|
resolver := metadataResolutionParams{ |
|
|
|
dirQuorum: askDisks - 1, |
|
|
|
dirQuorum: listingQuorum, |
|
|
|
objQuorum: askDisks - 1, |
|
|
|
objQuorum: listingQuorum, |
|
|
|
bucket: o.Bucket, |
|
|
|
bucket: o.Bucket, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -726,7 +738,7 @@ func (er *erasureObjects) listPath(ctx context.Context, o listPathOptions) (entr |
|
|
|
path: o.BaseDir, |
|
|
|
path: o.BaseDir, |
|
|
|
recursive: o.Recursive, |
|
|
|
recursive: o.Recursive, |
|
|
|
filterPrefix: o.FilterPrefix, |
|
|
|
filterPrefix: o.FilterPrefix, |
|
|
|
minDisks: askDisks - 1, |
|
|
|
minDisks: listingQuorum, |
|
|
|
agreed: func(entry metaCacheEntry) { |
|
|
|
agreed: func(entry metaCacheEntry) { |
|
|
|
cacheCh <- entry |
|
|
|
cacheCh <- entry |
|
|
|
filterCh <- entry |
|
|
|
filterCh <- entry |
|
|
|