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

br: Fix backup rawkv failure #32612

Merged
merged 13 commits into from
Mar 3, 2022
Prev Previous commit
Next Next commit
br: fix br raw backup
Issue Number: close #32607

Signed-off-by: pingyu <yuping@pingcap.com>
  • Loading branch information
pingyu committed Mar 1, 2022
commit 5237bbd73d88ef2f81f898ecb2170ca6a739d3cd
3 changes: 2 additions & 1 deletion br/pkg/restore/split.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ func (rs *RegionSplitter) Split(
ctx context.Context,
ranges []rtree.Range,
rewriteRules *RewriteRules,
isRawKv bool,
onSplit OnSplitFunc,
) error {
if len(ranges) == 0 {
Expand Down Expand Up @@ -111,7 +112,7 @@ SplitRegions:
}
return errors.Trace(errScan)
}
splitKeyMap := getSplitKeys(rewriteRules, sortedRanges, regions, true)
splitKeyMap := getSplitKeys(rewriteRules, sortedRanges, regions, isRawKv)
regionMap := make(map[uint64]*RegionInfo)
for _, region := range regions {
regionMap[region.Region.GetId()] = region
Expand Down
4 changes: 2 additions & 2 deletions br/pkg/restore/split_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ func TestScatterFinishInTime(t *testing.T) {
regionSplitter := restore.NewRegionSplitter(client)

ctx := context.Background()
err := regionSplitter.Split(ctx, ranges, rewriteRules, func(key [][]byte) {})
err := regionSplitter.Split(ctx, ranges, rewriteRules, false, func(key [][]byte) {})
require.NoError(t, err)
regions := client.GetAllRegions()
if !validateRegions(regions) {
Expand Down Expand Up @@ -329,7 +329,7 @@ func runTestSplitAndScatterWith(t *testing.T, client *TestClient) {
regionSplitter := restore.NewRegionSplitter(client)

ctx := context.Background()
err := regionSplitter.Split(ctx, ranges, rewriteRules, func(key [][]byte) {})
err := regionSplitter.Split(ctx, ranges, rewriteRules, false, func(key [][]byte) {})
require.NoError(t, err)
regions := client.GetAllRegions()
if !validateRegions(regions) {
Expand Down
2 changes: 1 addition & 1 deletion br/pkg/restore/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ func SplitRanges(
) error {
splitter := NewRegionSplitter(NewSplitClient(client.GetPDClient(), client.GetTLSConfig(), isRawKv))

return splitter.Split(ctx, ranges, rewriteRules, func(keys [][]byte) {
return splitter.Split(ctx, ranges, rewriteRules, isRawKv, func(keys [][]byte) {
for range keys {
updateCh.Inc()
}
Expand Down