Skip to content

Commit

Permalink
region_cache: fix a potential data race on store.addr (#1545)
Browse files Browse the repository at this point in the history
close #1544

Signed-off-by: zyguan <[email protected]>
  • Loading branch information
zyguan authored Jan 13, 2025
1 parent 2eba2f6 commit d355434
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/locate/region_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -3078,7 +3078,7 @@ func (c *RegionCache) checkAndUpdateStoreHealthStatus(ctx context.Context, now t
func (c *RegionCache) reportStoreReplicaFlows() {
c.stores.forEach(func(store *Store) {
for destType := toLeader; destType < numReplicaFlowsType; destType++ {
metrics.TiKVPreferLeaderFlowsGauge.WithLabelValues(destType.String(), store.addr).Set(float64(store.getReplicaFlowsStats(destType)))
metrics.TiKVPreferLeaderFlowsGauge.WithLabelValues(destType.String(), strconv.FormatUint(store.storeID, 10)).Set(float64(store.getReplicaFlowsStats(destType)))
store.resetReplicaFlowsStats(destType)
}
})
Expand Down

0 comments on commit d355434

Please sign in to comment.