diff --git a/server/core/store.go b/server/core/store.go index 247b1e828b3a..1556d6d09553 100644 --- a/server/core/store.go +++ b/server/core/store.go @@ -496,9 +496,6 @@ var ( // tikv's store heartbeat for a short time, maybe caused by process restart or // temporary network failure. func (s *StoreInfo) IsDisconnected() bool { - if s == nil { - return true - } return s.DownTime() > storeDisconnectDuration } diff --git a/server/schedule/checker/rule_checker.go b/server/schedule/checker/rule_checker.go index da707488ea36..33156d181aeb 100644 --- a/server/schedule/checker/rule_checker.go +++ b/server/schedule/checker/rule_checker.go @@ -462,7 +462,7 @@ func (c *RuleChecker) fixOrphanPeers(region *core.RegionInfo, fit *placement.Reg if pinDownPeer.GetIsWitness() || orphanPeer.GetIsWitness() { continue } - // down peer's store should be disconnected + // pinDownPeer's store should be disconnected, because we use more strict judge before. if !isDisconnectedPeer(pinDownPeer) { continue } @@ -497,10 +497,6 @@ func (c *RuleChecker) fixOrphanPeers(region *core.RegionInfo, fit *placement.Reg checkerCounter.WithLabelValues("rule_checker", "remove-orphan-peer").Inc() return operator.CreateRemovePeerOperator("remove-unhealthy-orphan-peer", c.cluster, 0, region, orphanPeer.StoreId) } - if isDisconnectedPeer(orphanPeer) { - checkerCounter.WithLabelValues("rule_checker", "remove-orphan-peer").Inc() - return operator.CreateRemovePeerOperator("remove-disconnected-orphan-peer", c.cluster, 0, region, orphanPeer.StoreId) - } if hasHealthPeer { // there already exists a healthy orphan peer, so we can remove other orphan Peers. checkerCounter.WithLabelValues("rule_checker", "remove-orphan-peer").Inc()