Skip to content

Commit

Permalink
Merge branch 'master' into fix-unhealthy-repair
Browse files Browse the repository at this point in the history
  • Loading branch information
nolouch authored Jul 21, 2023
2 parents cf1d5ac + 4d9455d commit b3e3e00
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
6 changes: 3 additions & 3 deletions pkg/schedule/splitter/region_splitter.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ func (r *RegionSplitter) groupKeysByRegion(keys [][]byte) map[uint64]*regionGrou
if !r.checkRegionValid(region) {
continue
}
if bytes.Equal(region.GetStartKey(), key) {
continue
}
log.Info("found region",
zap.Uint64("region-id", region.GetID()),
logutil.ZapRedactByteString("key", key))
Expand All @@ -166,9 +169,6 @@ func (r *RegionSplitter) groupKeysByRegion(keys [][]byte) map[uint64]*regionGrou
}

func (r *RegionSplitter) checkRegionValid(region *core.RegionInfo) bool {
if r.cluster.IsRegionHot(region) {
return false
}
if !filter.IsRegionReplicated(r.cluster, region) {
r.cluster.AddSuspectRegions(region.GetID())
return false
Expand Down
5 changes: 1 addition & 4 deletions pkg/schedule/splitter/region_splitter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func (suite *regionSplitterTestSuite) TestGroupKeysByRegion() {
[]byte("fff"),
[]byte("zzz"),
})
suite.Len(groupKeys, 3)
suite.Len(groupKeys, 2)
for k, v := range groupKeys {
switch k {
case uint64(1):
Expand All @@ -131,9 +131,6 @@ func (suite *regionSplitterTestSuite) TestGroupKeysByRegion() {
case uint64(2):
suite.Len(v.keys, 1)
suite.Equal([]byte("ddd"), v.keys[0])
case uint64(3):
suite.Len(v.keys, 1)
suite.Equal([]byte("fff"), v.keys[0])
}
}
}

0 comments on commit b3e3e00

Please sign in to comment.