-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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: add region range check for batch scan regions #27192
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
/component br |
/sig migrate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rest lgtm
br/pkg/restore/split.go
Outdated
|
||
// current pd can't guarantee the consistency of returned regions | ||
if len(regions) == 0 { | ||
return nil, errors.New("scan region return empty result") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe a normalized error (i.e. berror.Errxxx
) here?
@@ -225,8 +225,7 @@ func (s *testRestoreUtilSuite) TestPaginateScanRegion(c *C) { | |||
regionMap := make(map[uint64]*restore.RegionInfo) | |||
regions := []*restore.RegionInfo{} | |||
batch, err := restore.PaginateScanRegion(ctx, NewTestClient(stores, regionMap, 0), []byte{}, []byte{}, 3) | |||
c.Assert(err, IsNil) | |||
c.Assert(batch, DeepEquals, regions) | |||
c.Assert(err, ErrorMatches, ".*scan region return empty result.*") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a case testing holes found during scanning regions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
/build |
/run-check_dev_2 |
/run-check_dev_2 |
1 similar comment
/run-check_dev_2 |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 14980d5
|
/build |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-5.2 in PR #27220 |
What problem does this PR solve?
Currently, the implement of pd's batch scan regions can't guarantee consistency, so we add extra check for return returned region [startKey, endKey) check to ensure if there are potential range gap, the method will return an error.
What is changed and how it works?
Proposal: xxx
What's Changed:
How it Works:
Check List
Tests
Side effects
Documentation
Release note