mirror of
https://github.com/minio/minio.git
synced 2025-05-21 17:43:48 -04:00
allow ListObjects() when a prefix is an object (#17074)
This commit is contained in:
parent
dbd53af369
commit
b1f3935c5b
@ -23,7 +23,6 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"hash/crc32"
|
"hash/crc32"
|
||||||
"io"
|
"io"
|
||||||
"strings"
|
|
||||||
|
|
||||||
"github.com/minio/minio/internal/logger"
|
"github.com/minio/minio/internal/logger"
|
||||||
"github.com/minio/minio/internal/sync/errgroup"
|
"github.com/minio/minio/internal/sync/errgroup"
|
||||||
@ -173,10 +172,8 @@ func readAllFileInfo(ctx context.Context, disks []StorageAPI, bucket, object, ve
|
|||||||
errFileVersionNotFound,
|
errFileVersionNotFound,
|
||||||
errDiskNotFound,
|
errDiskNotFound,
|
||||||
errUnformattedDisk,
|
errUnformattedDisk,
|
||||||
}
|
io.ErrUnexpectedEOF, // some times we would read without locks, ignore these errors
|
||||||
if strings.HasPrefix(bucket, minioMetaBucket) {
|
io.EOF, // some times we would read without locks, ignore these errors
|
||||||
// listing object might be truncated, ignore such errors from logging.
|
|
||||||
ignoredErrs = append(ignoredErrs, io.ErrUnexpectedEOF)
|
|
||||||
}
|
}
|
||||||
errs := g.Wait()
|
errs := g.Wait()
|
||||||
for index, err := range errs {
|
for index, err := range errs {
|
||||||
|
@ -552,6 +552,8 @@ func readAllXL(ctx context.Context, disks []StorageAPI, bucket, object string, r
|
|||||||
errVolumeNotFound,
|
errVolumeNotFound,
|
||||||
errFileVersionNotFound,
|
errFileVersionNotFound,
|
||||||
errDiskNotFound,
|
errDiskNotFound,
|
||||||
|
io.ErrUnexpectedEOF, // some times we would read without locks, ignore these errors
|
||||||
|
io.EOF, // some times we would read without locks, ignore these errors
|
||||||
}
|
}
|
||||||
|
|
||||||
errs := g.Wait()
|
errs := g.Wait()
|
||||||
@ -559,13 +561,6 @@ func readAllXL(ctx context.Context, disks []StorageAPI, bucket, object string, r
|
|||||||
if err == nil {
|
if err == nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if bucket == minioMetaBucket {
|
|
||||||
// minioMetaBucket "reads" for .metacache are not written with O_SYNC
|
|
||||||
// so there is a potential for them to not fully committed to stable
|
|
||||||
// storage leading to unexpected EOFs. Allow these failures to
|
|
||||||
// be ignored since the caller already ignores them in streamMetadataParts()
|
|
||||||
ignoredErrs = append(ignoredErrs, io.ErrUnexpectedEOF, io.EOF)
|
|
||||||
}
|
|
||||||
if !IsErr(err, ignoredErrs...) {
|
if !IsErr(err, ignoredErrs...) {
|
||||||
logger.LogOnceIf(ctx, fmt.Errorf("Drive %s, path (%s/%s) returned an error (%w)",
|
logger.LogOnceIf(ctx, fmt.Errorf("Drive %s, path (%s/%s) returned an error (%w)",
|
||||||
disks[index], bucket, object, err),
|
disks[index], bucket, object, err),
|
||||||
|
@ -1307,7 +1307,7 @@ func (z *erasureServerPools) ListObjects(ctx context.Context, bucket, prefix, ma
|
|||||||
}
|
}
|
||||||
opts.setBucketMeta(ctx)
|
opts.setBucketMeta(ctx)
|
||||||
|
|
||||||
if len(prefix) > 0 && maxKeys == 1 && delimiter == "" && marker == "" {
|
if len(prefix) > 0 && maxKeys == 1 && marker == "" {
|
||||||
// Optimization for certain applications like
|
// Optimization for certain applications like
|
||||||
// - Cohesity
|
// - Cohesity
|
||||||
// - Actifio, Splunk etc.
|
// - Actifio, Splunk etc.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user