Skip to content

Commit

Permalink
restore: Revert "split between tables" (#43435) (#43547)
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-chi-bot authored May 8, 2023
1 parent ae2c5bd commit 8b2d294
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
5 changes: 0 additions & 5 deletions br/pkg/restore/split.go
Original file line number Diff line number Diff line change
Expand Up @@ -385,11 +385,6 @@ func (rs *RegionSplitter) ScatterRegions(ctx context.Context, newRegions []*spli
func getSplitKeys(rewriteRules *RewriteRules, ranges []rtree.Range, regions []*split.RegionInfo, isRawKv bool) map[uint64][][]byte {
splitKeyMap := make(map[uint64][][]byte)
checkKeys := make([][]byte, 0)
if rewriteRules != nil && len(rewriteRules.NewKeyspace) == 0 {
for _, rule := range rewriteRules.Data {
checkKeys = append(checkKeys, rule.NewKeyPrefix)
}
}
for _, rg := range ranges {
checkKeys = append(checkKeys, rg.EndKey)
}
Expand Down
8 changes: 3 additions & 5 deletions br/pkg/restore/split_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -479,12 +479,10 @@ func initRewriteRules() *restore.RewriteRules {

// expected regions after split:
//
// [aa, aay), [aay, bba), [bba, bbf), [bbf, bbh), [bbh, bbj),
// [bbj, cca), [cca, xx), [xx, xxe), [xxe, xxz), [xxz, )
//
// Please note that "aa" has been rewritten to "xx", so the "bb" rewrite rule split point won't be included.
// [, aay), [aay, bba), [bba, bbf), [bbf, bbh), [bbh, bbj),
// [bbj, cca), [cca, xxe), [xxe, xxz), [xxz, )
func validateRegions(regions map[uint64]*split.RegionInfo) bool {
keys := [...]string{"", "aay", "bba", "bbf", "bbh", "bbj", "cca", "xx", "xxe", "xxz", ""}
keys := [...]string{"", "aay", "bba", "bbf", "bbh", "bbj", "cca", "xxe", "xxz", ""}
return validateRegionsExt(regions, keys[:], false)
}

Expand Down

0 comments on commit 8b2d294

Please sign in to comment.