|
|
@ -319,7 +319,7 @@ func (r *metacacheReader) filter(o listPathOptions) (entries metaCacheEntriesSor |
|
|
|
entries.o = append(entries.o, entry) |
|
|
|
entries.o = append(entries.o, entry) |
|
|
|
return entries.len() < o.Limit |
|
|
|
return entries.len() < o.Limit |
|
|
|
}) |
|
|
|
}) |
|
|
|
if err == io.EOF || pastPrefix || r.nextEOF() { |
|
|
|
if (err != nil && err.Error() == io.EOF.Error()) || pastPrefix || r.nextEOF() { |
|
|
|
return entries, io.EOF |
|
|
|
return entries, io.EOF |
|
|
|
} |
|
|
|
} |
|
|
|
return entries, err |
|
|
|
return entries, err |
|
|
@ -632,6 +632,9 @@ func (er *erasureObjects) listPath(ctx context.Context, o listPathOptions) (entr |
|
|
|
} |
|
|
|
} |
|
|
|
}() |
|
|
|
}() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const retryDelay = 200 * time.Millisecond |
|
|
|
|
|
|
|
const maxTries = 10 |
|
|
|
|
|
|
|
|
|
|
|
// Write results to disk.
|
|
|
|
// Write results to disk.
|
|
|
|
bw := newMetacacheBlockWriter(cacheCh, func(b *metacacheBlock) error { |
|
|
|
bw := newMetacacheBlockWriter(cacheCh, func(b *metacacheBlock) error { |
|
|
|
if debugPrint { |
|
|
|
if debugPrint { |
|
|
@ -654,13 +657,24 @@ func (er *erasureObjects) listPath(ctx context.Context, o listPathOptions) (entr |
|
|
|
return nil |
|
|
|
return nil |
|
|
|
} |
|
|
|
} |
|
|
|
// Update block 0 metadata.
|
|
|
|
// Update block 0 metadata.
|
|
|
|
|
|
|
|
var retries int |
|
|
|
for { |
|
|
|
for { |
|
|
|
err := er.updateObjectMeta(ctx, minioMetaBucket, o.objectPath(0), b.headerKV(), ObjectOptions{}) |
|
|
|
err := er.updateObjectMeta(ctx, minioMetaBucket, o.objectPath(0), b.headerKV(), ObjectOptions{}) |
|
|
|
if err == nil { |
|
|
|
if err == nil { |
|
|
|
break |
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
switch err.(type) { |
|
|
|
|
|
|
|
case ObjectNotFound: |
|
|
|
|
|
|
|
return err |
|
|
|
|
|
|
|
case InsufficientReadQuorum: |
|
|
|
|
|
|
|
default: |
|
|
|
logger.LogIf(ctx, err) |
|
|
|
logger.LogIf(ctx, err) |
|
|
|
time.Sleep(100 * time.Millisecond) |
|
|
|
} |
|
|
|
|
|
|
|
if retries >= maxTries { |
|
|
|
|
|
|
|
return err |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
retries++ |
|
|
|
|
|
|
|
time.Sleep(retryDelay) |
|
|
|
} |
|
|
|
} |
|
|
|
return nil |
|
|
|
return nil |
|
|
|
}) |
|
|
|
}) |
|
|
|