From a99abe3cf2326c2a8e0617594b9f4f4615b608d4 Mon Sep 17 00:00:00 2001 From: Ryan Leung Date: Fri, 17 Jan 2025 15:29:22 +0800 Subject: [PATCH] cluster: remove unnecessary get store (#9002) ref tikv/pd#9003 Signed-off-by: Ryan Leung --- server/cluster/cluster.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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.