Remove empty replication stats (#19385)

When sending final stats upstream also trim empty ReplicationStats.
This commit is contained in:
Klaus Post 2024-03-29 11:57:52 -07:00 committed by GitHub
parent 72c7845f7e
commit 3d6194e93c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View File

@ -543,9 +543,13 @@ func (er erasureObjects) nsScanner(ctx context.Context, buckets []BucketInfo, wa
}
wg.Wait()
// Flatten for upstream, but save full state.
var root dataUsageEntry
if r := cache.root(); r != nil {
root = cache.flatten(*r)
if root.ReplicationStats.empty() {
root.ReplicationStats = nil
}
}
select {
case <-ctx.Done():