Skip to content

Commit

Permalink
unsafe recovery: Add log for overlapping regions in unsafe recovery (#…
Browse files Browse the repository at this point in the history
…6959)

ref #6859

Add log for overlapping regions in unsafe recovery.

We were unable to find the root cause of #6859, adding this log may help us better identify the issue, by printing out the regions that overlap with each other, that causes some of them to be marked as tombstone.

Signed-off-by: Yang Zhang <[email protected]>
  • Loading branch information
v01dstar authored Sep 8, 2023
1 parent 74ead5c commit 1fbe2d7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/unsaferecovery/unsafe_recovery_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -890,10 +890,11 @@ func (t *regionTree) insert(item *regionItem) (bool, error) {
return false, errors.Errorf("region %v shouldn't be updated twice", item.Region().GetId())
}

for _, old := range overlaps {
for _, newer := range overlaps {
log.Info("Unsafe recovery found overlap regions", logutil.ZapRedactStringer("newer-region-meta", core.RegionToHexMeta(newer.Region())), logutil.ZapRedactStringer("older-region-meta", core.RegionToHexMeta(item.Region())))
// it's ensured by the `buildUpFromReports` that peers are inserted in epoch descending order.
if old.IsEpochStale(item) {
return false, errors.Errorf("region %v's epoch shouldn't be staler than old ones %v", item, old)
if newer.IsEpochStale(item) {
return false, errors.Errorf("region %v's epoch shouldn't be staler than old ones %v", item, newer)
}
}
if len(overlaps) != 0 {
Expand Down

0 comments on commit 1fbe2d7

Please sign in to comment.