-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
*: support a region divided into multiple regions #11739
Conversation
Codecov Report
@@ Coverage Diff @@
## master #11739 +/- ##
================================================
+ Coverage 81.3475% 81.3521% +0.0045%
================================================
Files 444 444
Lines 95103 95180 +77
================================================
+ Hits 77364 77431 +67
- Misses 12233 12246 +13
+ Partials 5506 5503 -3 |
PTAL @crazycs520 @bb7133 |
PTAL @crazycs520 @bb7133 |
@zimulala Please give some results of performance improvement |
if len(regionIDs) == 1 { | ||
return regionIDs[0] | ||
} | ||
return 0 |
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.
Shall we return an error here?
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.
It's the original code and several functions on the upper layer also did not return an error message.
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.
LGTM
} | ||
regionIDs = append(regionIDs, regionID) | ||
|
||
regionIDs, err := s.SplitRegions(context.Background(), splitIdxKeys, true) |
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.
Why not using ctxWithTimeout
here? IMHO a timeout is still needed
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.
The original code hasn't and SplitRegions
has itself timeout, so I don't add it.
If you feel the need, is there a suggested value?
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.
OK, never mind
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.
LGTM
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.
LGTM
/run-all-tests |
@zimulala merge failed. |
/run-integration-common-test |
12242a1
to
6c38a18
Compare
/run-all-tests |
cherry pick to release-3.0 failed |
cherry pick to release-2.1 failed |
What problem does this PR solve?
Serial splitting and scattering regions take a long time.
Related to pingcap/kvproto#440, tikv/tikv#5268
What is changed and how it works?
If some split keys in a region, we can batch split these keys. Then we can split a region into several regions in a request. And we split of different regions in parallel.
Check List
Tests
Code changes