Skip to content

Commit

Permalink
Remove overlap check
Browse files Browse the repository at this point in the history
Signed-off-by: Yang Zhang <[email protected]>
  • Loading branch information
v01dstar committed Apr 1, 2024
1 parent 6ea3d29 commit 8464af0
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions server/cluster/unsafe_recovery_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8464af0

Please sign in to comment.