-
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
ddl: add table option pre_split_regions for pre-split region when create table with shard_row_id_bits. #10138
Conversation
Codecov Report
@@ Coverage Diff @@
## master #10138 +/- ##
================================================
+ Coverage 77.8697% 77.8876% +0.0178%
================================================
Files 409 407 -2
Lines 84188 82732 -1456
================================================
- Hits 65557 64438 -1119
+ Misses 13742 13511 -231
+ Partials 4889 4783 -106 |
Please update the desc |
Can we try to detect the scattering operator is finished then return the DDL job is finished, like https://github.com/tikv/tikv/pull/4423/files#diff-14a21dd3ee41f0c7bb3547557e5c815cR223? |
Please update go.sum / go.mod for the parser |
ddl/table.go
Outdated
@@ -74,6 +74,7 @@ func onCreateTable(d *ddlCtx, t *meta.Meta, job *model.Job) (ver int64, _ error) | |||
// TODO: Add restrictions to this operation. | |||
go splitTableRegion(d.store, tbInfo.ID) |
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.
Should we modify splitTableRegion strategy 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.
This PR is not to do this.
Can we show the |
@nolouch Done. |
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
} | ||
|
||
func (s *tikvStore) SplitRegionAndScatter(splitKey kv.Key) (uint64, error) { | ||
left, err := s.splitRegion(splitKey) |
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.
If splitRegion
failed will retry to split? such as epoch is not matched
.
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.
There is a Backoff
in splitRegion
, so it will retry.
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 |
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
…ate table with shard_row_id_bits. (pingcap#10138)
What problem does this PR solve?
Pre-split table region when creat table with shard_row_id_bits.
If we do not pre-split region, there is only 1 region of the table at first, then maybe still have write hot spots at the beginning.
What is changed and how it works?
Do pre-split region when create table with
shard_row_id_bits
andpre_split_regions
.scatter split region. Wait PD PR merge: client: supports scatter region and get operator status tikv/pd#1501
Pre-split region will split 2^(pre_split_regions-1) for table row data, split 1 region for every index separately.
The pre-split process was executed asynchronous.
Check List
Tests
Code changes
Side effects