Skip to content

Commit

Permalink
checker: judging that the peer is down is no longer based on DownSeco…
Browse files Browse the repository at this point in the history
…nds (#4078) (#4081)

* This is an automated cherry-pick of #4078

Signed-off-by: ti-chi-bot <[email protected]>

* resolve conflict

Signed-off-by: nolouch <[email protected]>

Co-authored-by: 混沌DM <[email protected]>
Co-authored-by: nolouch <[email protected]>
  • Loading branch information
3 people authored Sep 8, 2021
1 parent 20099bd commit 2ddff54
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions server/schedule/checker/replica_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,10 @@ func (r *ReplicaChecker) checkDownPeer(region *core.RegionInfo) *operator.Operat
log.Warn("lost the store, maybe you are recovering the PD cluster", zap.Uint64("store-id", storeID))
return nil
}
// Only consider the state of the Store, not `stats.DownSeconds`.
if store.DownTime() < r.cluster.GetMaxStoreDownTime() {
continue
}
if stats.GetDownSeconds() < uint64(r.cluster.GetMaxStoreDownTime().Seconds()) {
continue
}

return r.fixPeer(region, peer, downStatus)
}
Expand Down
4 changes: 1 addition & 3 deletions server/schedule/checker/rule_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,10 @@ func (c *RuleChecker) isDownPeer(region *core.RegionInfo, peer *metapb.Peer) boo
log.Warn("lost the store, maybe you are recovering the PD cluster", zap.Uint64("store-id", storeID))
return false
}
// Only consider the state of the Store, not `stats.DownSeconds`.
if store.DownTime() < c.cluster.GetMaxStoreDownTime() {
continue
}
if stats.GetDownSeconds() < uint64(c.cluster.GetMaxStoreDownTime().Seconds()) {
continue
}
return true
}
return false
Expand Down

0 comments on commit 2ddff54

Please sign in to comment.