mirror of
https://github.com/pgsty/minio.git
synced 2026-08-09 15:53:28 +03:00
use list cache for Walk() with webUI and quota (#10814)
bring list cache optimizations for web UI object listing, also FIFO quota enforcement through list cache as well.
This commit is contained in:
@@ -99,7 +99,8 @@ func (z *erasureServerSets) listPath(ctx context.Context, o listPathOptions) (en
|
||||
if err != nil {
|
||||
if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) {
|
||||
// Context is canceled, return at once.
|
||||
return entries, err
|
||||
// request canceled, no entries to return
|
||||
return entries, io.EOF
|
||||
}
|
||||
logger.LogIf(ctx, err)
|
||||
cache = localMetacacheMgr.getTransient().findCache(o)
|
||||
@@ -109,17 +110,14 @@ func (z *erasureServerSets) listPath(ctx context.Context, o listPathOptions) (en
|
||||
}
|
||||
}
|
||||
if cache.fileNotFound {
|
||||
return entries, errFileNotFound
|
||||
// No cache found, no entries found.
|
||||
return entries, io.EOF
|
||||
}
|
||||
// Only create if we created a new.
|
||||
o.Create = o.ID == cache.id
|
||||
o.ID = cache.id
|
||||
}
|
||||
|
||||
if o.AskDisks == 0 {
|
||||
o.AskDisks = globalAPIConfig.getListQuorum()
|
||||
}
|
||||
|
||||
var mu sync.Mutex
|
||||
var wg sync.WaitGroup
|
||||
var errs []error
|
||||
@@ -175,7 +173,8 @@ func (z *erasureServerSets) listPath(ctx context.Context, o listPathOptions) (en
|
||||
cache.fileNotFound = true
|
||||
_, err := o.updateMetacacheListing(cache, globalNotificationSys.restClientFromHash(o.Bucket))
|
||||
logger.LogIf(ctx, err)
|
||||
return entries, errFileNotFound
|
||||
// cache returned not found, entries truncated.
|
||||
return entries, io.EOF
|
||||
}
|
||||
|
||||
for _, err := range errs {
|
||||
|
||||
Reference in New Issue
Block a user