diff --git a/server/cluster/cluster.go b/server/cluster/cluster.go index f11c16032d8..6a0416acd67 100644 --- a/server/cluster/cluster.go +++ b/server/cluster/cluster.go @@ -1040,9 +1040,7 @@ func (c *RaftCluster) HandleStoreHeartbeat(heartbeat *pdpb.StoreHeartbeatRequest newStore = newStore.Clone(core.SetLastPersistTime(nowTime)) } } - if store := c.GetStore(storeID); store != nil { - statistics.UpdateStoreHeartbeatMetrics(store) - } + statistics.UpdateStoreHeartbeatMetrics(store) // Supply NodeState in the response to help the store handle special cases // more conveniently, such as avoiding calling `remove_peer` redundantly under // NodeState_Removing.