mirror of
https://github.com/pgsty/minio.git
synced 2026-07-19 12:10:24 +03:00
metacache: Allow prefix filtering (#10920)
Do listings with prefix filter when bloom filter is dirty. This will forward the prefix filter to the lister which will make it only scan the folders/objects with the specified prefix. If we have a clean bloom filter we try to build a more generally useful cache so in that case, we will list all objects/folders.
This commit is contained in:
@@ -228,6 +228,10 @@ func (b *bucketMetacache) findCache(o listPathOptions) metacache {
|
||||
debugPrint("cache %s prefix mismatch, cached:%v, want:%v", cached.id, cached.root, o.BaseDir)
|
||||
continue
|
||||
}
|
||||
if cached.filter != "" && strings.HasPrefix(cached.filter, o.FilterPrefix) {
|
||||
debugPrint("cache %s cannot be used because of filter %s", cached.id, cached.filter)
|
||||
continue
|
||||
}
|
||||
// If the existing listing wasn't recursive root must match.
|
||||
if !cached.recursive && o.BaseDir != cached.root {
|
||||
debugPrint("cache %s non rec prefix mismatch, cached:%v, want:%v", cached.id, cached.root, o.BaseDir)
|
||||
|
||||
Reference in New Issue
Block a user