mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
Fix uninitialized replication stats (#20260)
Services are unfrozen before `initBackgroundReplication` is finished. This means that the globalReplicationStats write is racy. Switch to an atomic pointer. Provide the `ReplicationPool` with the stats, so it doesn't have to be grabbed from the atomic pointer on every use. All other loads and checks are nil, and calls return empty values when stats still haven't been initialized.
This commit is contained in:
@@ -119,7 +119,7 @@ func loadBucketReplicationMetrics(ctx context.Context, m MetricValues, c *metric
|
||||
return nil
|
||||
}
|
||||
|
||||
bucketReplStats := globalReplicationStats.getAllLatest(dataUsageInfo.BucketsUsage)
|
||||
bucketReplStats := globalReplicationStats.Load().getAllLatest(dataUsageInfo.BucketsUsage)
|
||||
for _, bucket := range buckets {
|
||||
labels := []string{bucketL, bucket}
|
||||
if s, ok := bucketReplStats[bucket]; ok {
|
||||
|
||||
Reference in New Issue
Block a user