mirror of
https://github.com/minio/minio.git
synced 2024-12-25 06:35:56 -05:00
Usage: Reset merged info when updating (#10126)
When merging multiple buckets reset between each update. Avoids merging the same usage metrics multiple times resulting in duplicate data entries.
This commit is contained in:
parent
10025bda45
commit
11593c6cc4
@ -340,12 +340,13 @@ func (z *erasureZones) CrawlAndGetDataUsage(ctx context.Context, bf *bloomFilter
|
|||||||
|
|
||||||
// We need to merge since we will get the same buckets from each zone.
|
// We need to merge since we will get the same buckets from each zone.
|
||||||
// Therefore to get the exact bucket sizes we must merge before we can convert.
|
// Therefore to get the exact bucket sizes we must merge before we can convert.
|
||||||
allMerged := dataUsageCache{Info: dataUsageCacheInfo{Name: dataUsageRoot}}
|
var allMerged dataUsageCache
|
||||||
|
|
||||||
update := func() {
|
update := func() {
|
||||||
mu.Lock()
|
mu.Lock()
|
||||||
defer mu.Unlock()
|
defer mu.Unlock()
|
||||||
|
|
||||||
|
allMerged = dataUsageCache{Info: dataUsageCacheInfo{Name: dataUsageRoot}}
|
||||||
for _, info := range results {
|
for _, info := range results {
|
||||||
if info.Info.LastUpdate.IsZero() {
|
if info.Info.LastUpdate.IsZero() {
|
||||||
// Not filled yet.
|
// Not filled yet.
|
||||||
|
Loading…
Reference in New Issue
Block a user