|
|
@ -22,6 +22,7 @@ import ( |
|
|
|
"io" |
|
|
|
"io" |
|
|
|
"path" |
|
|
|
"path" |
|
|
|
"sync" |
|
|
|
"sync" |
|
|
|
|
|
|
|
"time" |
|
|
|
|
|
|
|
|
|
|
|
"github.com/minio/minio/cmd/logger" |
|
|
|
"github.com/minio/minio/cmd/logger" |
|
|
|
) |
|
|
|
) |
|
|
@ -103,14 +104,18 @@ func (z *erasureServerSets) listPath(ctx context.Context, o listPathOptions) (en |
|
|
|
// Local
|
|
|
|
// Local
|
|
|
|
cache = localMetacacheMgr.findCache(ctx, o) |
|
|
|
cache = localMetacacheMgr.findCache(ctx, o) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
|
|
|
|
ctx, cancel := context.WithTimeout(ctx, 5*time.Second) |
|
|
|
|
|
|
|
defer cancel() |
|
|
|
c, err := rpc.GetMetacacheListing(ctx, o) |
|
|
|
c, err := rpc.GetMetacacheListing(ctx, o) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) { |
|
|
|
if errors.Is(err, context.Canceled) { |
|
|
|
// Context is canceled, return at once.
|
|
|
|
// Context is canceled, return at once.
|
|
|
|
// request canceled, no entries to return
|
|
|
|
// request canceled, no entries to return
|
|
|
|
return entries, io.EOF |
|
|
|
return entries, io.EOF |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if !errors.Is(err, context.DeadlineExceeded) { |
|
|
|
logger.LogIf(ctx, err) |
|
|
|
logger.LogIf(ctx, err) |
|
|
|
|
|
|
|
} |
|
|
|
o.Transient = true |
|
|
|
o.Transient = true |
|
|
|
cache = localMetacacheMgr.findCache(ctx, o) |
|
|
|
cache = localMetacacheMgr.findCache(ctx, o) |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -176,11 +181,12 @@ func (z *erasureServerSets) listPath(ctx context.Context, o listPathOptions) (en |
|
|
|
|
|
|
|
|
|
|
|
if isAllNotFound(errs) { |
|
|
|
if isAllNotFound(errs) { |
|
|
|
// All sets returned not found.
|
|
|
|
// All sets returned not found.
|
|
|
|
|
|
|
|
go func() { |
|
|
|
// Update master cache with that information.
|
|
|
|
// Update master cache with that information.
|
|
|
|
cache.status = scanStateSuccess |
|
|
|
cache.status = scanStateSuccess |
|
|
|
cache.fileNotFound = true |
|
|
|
cache.fileNotFound = true |
|
|
|
_, err := o.updateMetacacheListing(cache, globalNotificationSys.restClientFromHash(o.Bucket)) |
|
|
|
o.updateMetacacheListing(cache, globalNotificationSys.restClientFromHash(o.Bucket)) |
|
|
|
logger.LogIf(ctx, err) |
|
|
|
}() |
|
|
|
// cache returned not found, entries truncated.
|
|
|
|
// cache returned not found, entries truncated.
|
|
|
|
return entries, io.EOF |
|
|
|
return entries, io.EOF |
|
|
|
} |
|
|
|
} |
|
|
|