mirror of
https://github.com/pgsty/minio.git
synced 2026-07-25 06:56:18 +03:00
fix: metacache should only rename entries during cleanup (#11503)
To avoid large delays in metacache cleanup, use rename instead of recursive delete calls, renames are cheaper move the content to minioMetaTmpBucket and then cleanup this folder once in 24hrs instead. If the new cache can replace an existing one, we should let it replace since that is currently being saved anyways, this avoids pile up of 1000's of metacache entires for same listing calls that are not necessary to be stored on disk.
This commit is contained in:
@@ -92,7 +92,6 @@ func (m *metacacheManager) initManager() {
|
||||
}
|
||||
m.mu.Unlock()
|
||||
}
|
||||
m.getTransient().deleteAll()
|
||||
}()
|
||||
}
|
||||
|
||||
@@ -124,11 +123,11 @@ func (m *metacacheManager) updateCacheEntry(update metacache) (metacache, error)
|
||||
}
|
||||
|
||||
b, ok := m.buckets[update.bucket]
|
||||
m.mu.RUnlock()
|
||||
if ok {
|
||||
m.mu.RUnlock()
|
||||
return b.updateCacheEntry(update)
|
||||
}
|
||||
m.mu.RUnlock()
|
||||
|
||||
// We should have either a trashed bucket or this
|
||||
return metacache{}, errVolumeNotFound
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user