Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: remove the overlaps logic in UpdateSubTree #8137

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions pkg/core/region.go
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,7 @@
if ok {
origin = originItem.RegionInfo
}
rangeChanged := true

Check failure on line 1077 in pkg/core/region.go

View workflow job for this annotation

GitHub Actions / statics

ineffectual assignment to rangeChanged (ineffassign)

if origin != nil {
re := region.GetRegionEpoch()
Expand Down Expand Up @@ -1106,13 +1106,7 @@
}
}

if rangeChanged {
overlaps := r.getOverlapRegionFromSubTreeLocked(region)
for _, re := range overlaps {
r.removeRegionFromSubTreeLocked(re)
}
}

// update will remove overlaps
item := &regionItem{region}
r.subRegions[region.GetID()] = item
// It has been removed and all information needs to be updated again.
Expand Down Expand Up @@ -1152,7 +1146,7 @@
setPeers(r.pendingPeers, region.GetPendingPeers())
}

func (r *RegionsInfo) getOverlapRegionFromSubTreeLocked(region *RegionInfo) []*RegionInfo {

Check failure on line 1149 in pkg/core/region.go

View workflow job for this annotation

GitHub Actions / statics

func `(*RegionsInfo).getOverlapRegionFromSubTreeLocked` is unused (unused)
it := &regionItem{RegionInfo: region}
overlaps := make([]*RegionInfo, 0)
overlapsMap := make(map[uint64]struct{})
Expand Down
Loading