-
Notifications
You must be signed in to change notification settings - Fork 6k
ddl: support scatter region in cluster/global level #56157
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
Conversation
Hi @River2000i. Thanks for your PR. I'm waiting for a pingcap member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Hi @River2000i. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
@D3Hunter @Benjamin2037 PTAL~ |
/ok-to-test |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #56157 +/- ##
================================================
+ Coverage 73.4156% 76.4343% +3.0186%
================================================
Files 1605 1656 +51
Lines 445006 460780 +15774
================================================
+ Hits 326704 352194 +25490
+ Misses 98251 87181 -11070
- Partials 20051 21405 +1354
Flags with carried forward coverage won't be shown. Click here to find out more.
|
/retest |
/test pull-br-integration-tes |
/test pull-br-integration-test |
@River2000i: The specified target(s) for
Use In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/retest |
/hold |
# Conflicts: # pkg/session/bootstrap.go
/retest |
1 similar comment
/retest |
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
tableStartKey := tablecodec.GenTablePrefix(physicalTableID) | ||
regionIDs, err := store.SplitRegions(ctx, [][]byte{tableStartKey}, scatter, &tableID) | ||
scatter, tID := getScatterConfig(scatterScope, tableID) | ||
regionIDs, err := store.SplitRegions(ctx, [][]byte{tableStartKey}, scatter, &tID) |
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.
so -1 is ok or it should be nil 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.
Both is ok. In client-go, the tableID
will convert from *int64 to string. If it's nil, it will equal "0"
. The -1 is used to distinguish it from the default setting of 0 in client-go.
refer: https://github.com/tikv/client-go/blob/6ba909c4ad2de65b5b36d0e5036d0a85f3154cc0/tikv/split_region.go#L245-L248
/retest |
/retest |
/unhold |
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Benjamin2037, benmeadowcroft, GMHDBJD, Leavrth, wjhuang2016 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest |
2 similar comments
/retest |
/retest |
What problem does this PR solve?
Issue Number: close #55184 ref tikv/pd#8424 ref #54886
Problem Summary:
region distribution not balance in create table with enable
tidb_scatter_region
in cluster level.What changed and how does it work?
tidb_scatter_region
support""
,"table"
,"global"
instead ofon
andoff
.global
, trigger PD scatter region is achieved by passingtableID
as nil. WhentableID
is nil, PD selects new peers based on the cluster level by https://github.com/tikv/pd/blob/13174b5d4cab4d958f0b4ea2718ea7bb74992bc7/pkg/schedule/scatter/region_scatterer.go#L444Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.