From 8464af0ccf216f053699d9236fdf0b4d63990c1a Mon Sep 17 00:00:00 2001 From: Yang Zhang Date: Mon, 1 Apr 2024 15:52:42 -0700 Subject: [PATCH] Remove overlap check Signed-off-by: Yang Zhang --- server/cluster/unsafe_recovery_controller.go | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/server/cluster/unsafe_recovery_controller.go b/server/cluster/unsafe_recovery_controller.go index 6c2d5101928..ce90e4c706d 100644 --- a/server/cluster/unsafe_recovery_controller.go +++ b/server/cluster/unsafe_recovery_controller.go @@ -1159,25 +1159,6 @@ func (u *unsafeRecoveryController) generateCreateEmptyRegionPlan(newestRegionTre err = createRegionErr return false } - // paranoid check: shouldn't overlap with any of the peers - for _, peers := range peersMap { - for _, peer := range peers { - if !peer.IsInitialized() { - continue - } - if (bytes.Compare(newRegion.StartKey, peer.Region().StartKey) <= 0 && - (len(newRegion.EndKey) == 0 || bytes.Compare(peer.Region().StartKey, newRegion.EndKey) < 0)) || - ((len(peer.Region().EndKey) == 0 || bytes.Compare(newRegion.StartKey, peer.Region().EndKey) < 0) && - (len(newRegion.EndKey) == 0 || (len(peer.Region().EndKey) != 0 && bytes.Compare(peer.Region().EndKey, newRegion.EndKey) <= 0))) { - err = errors.Errorf( - "Find overlap peer %v with newly created empty region %v", - logutil.RedactStringer(core.RegionToHexMeta(peer.Region())), - logutil.RedactStringer(core.RegionToHexMeta(newRegion)), - ) - return false - } - } - } storeRecoveryPlan := u.getRecoveryPlan(storeID) storeRecoveryPlan.Creates = append(storeRecoveryPlan.Creates, newRegion) u.recordAffectedRegion(newRegion)