-
Notifications
You must be signed in to change notification settings - Fork 726
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
grpc-service: Add splitAndScatterRegions #4212
Conversation
[REVIEW NOTIFICATION] This pull request has not been approved. 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. |
@hzh0425: Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. 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. |
Does this PR have any context? |
Also need to update the context in this issue, and do you have a detail design RFC? |
close #4224 |
I know it's a subtask, But the design is different from the issue. Such as pingcap/tidb#25281, the first thing is to write the design RFC. we recommend writing proposal RFC before coding, for this topic you can discuss it at https://internals.tidb.io/t/topic/399. |
Currently this task is target to merge |
# Conflicts: # go.mod # go.sum
ref: pingcap/tidb#29034 |
/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.
the rest LGTM.
server/grpc_service.go
Outdated
if len(newRegions) > 1 { | ||
// Divide a region into n, one of them may not need to be scattered, | ||
// so n-1 needs to be scattered to other stores. | ||
newRegions = newRegions[:len(newRegions)-1] |
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.
I don't think we need this. The process of scatter is to place the regions randomly on the available store, and the original store can be selected too.
update SplitAndScatterRegions
* do not consider tiflash in region label monitor Signed-off-by: Ryan Leung <rleungx@gmail.com> * add a unit test Signed-off-by: Ryan Leung <rleungx@gmail.com> Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io> Signed-off-by: hzh0425 <642256541@qq.com>
…4213) Signed-off-by: HunDunDM <hundundm@gmail.com> Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io> Signed-off-by: hzh0425 <642256541@qq.com>
* client: support pass cert bytes in SecurityOption Signed-off-by: ehco1996 <zh19960202@gmail.com> * add more test Signed-off-by: ehco1996 <zh19960202@gmail.com> * fix lint Signed-off-by: ehco1996 <zh19960202@gmail.com> * address comment Signed-off-by: ehco1996 <zh19960202@gmail.com> * address comment Signed-off-by: ehco1996 <zh19960202@gmail.com> Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io> Signed-off-by: hzh0425 <642256541@qq.com>
* Refine some client code Signed-off-by: JmPotato <ghzpotato@gmail.com> * ref tikv#3149 Signed-off-by: JmPotato <ghzpotato@gmail.com> Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io> Signed-off-by: hzh0425 <642256541@qq.com>
* api: add http interface for scan regions in [startKey,endKey) Signed-off-by: IcePigZDB <icepigzdb@gmail.com> Signed-off-by: hzh0425 <642256541@qq.com>
close tikv#4237 Signed-off-by: disksing <i@disksing.com> Signed-off-by: hzh0425 <642256541@qq.com>
…ive TSO requests (tikv#4054) * Add tsoBatchController to control the TSO client batch interval Signed-off-by: JmPotato <ghzpotato@gmail.com> * Update the batch strategy of the TSO requests Signed-off-by: JmPotato <ghzpotato@gmail.com> * Introduce the dynamic bestBatchSize Signed-off-by: JmPotato <ghzpotato@gmail.com> * Refine the code Signed-off-by: JmPotato <ghzpotato@gmail.com> * Address the comments Signed-off-by: JmPotato <ghzpotato@gmail.com> * Refine the code Signed-off-by: JmPotato <ghzpotato@gmail.com> * Update the metrics for bestBatchSize Signed-off-by: JmPotato <ghzpotato@gmail.com> * Merge some methods Signed-off-by: JmPotato <ghzpotato@gmail.com> * Address the comment Signed-off-by: JmPotato <ghzpotato@gmail.com> * Simplify the code Signed-off-by: JmPotato <ghzpotato@gmail.com> * Address the comments Signed-off-by: JmPotato <ghzpotato@gmail.com> * Use break instead of goto Signed-off-by: JmPotato <ghzpotato@gmail.com> * Disable the new batch strategy by default Signed-off-by: JmPotato <ghzpotato@gmail.com> * Reduce the unnecessary change Signed-off-by: JmPotato <ghzpotato@gmail.com> * Add a TODO Signed-off-by: JmPotato <ghzpotato@gmail.com> * Make bestBatchSize start from a low value Signed-off-by: JmPotato <ghzpotato@gmail.com> * ref tikv#3149 Signed-off-by: JmPotato <ghzpotato@gmail.com> Signed-off-by: hzh0425 <642256541@qq.com>
* core:remove compaction for hot region history ref #pingcap/tidb/pull/25281 Signed-off-by: qidi1 <1083369179@qq.com> * ref tikv#4020 Signed-off-by: nolouch <nolouch@gmail.com> Co-authored-by: nolouch <nolouch@gmail.com> Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io> Signed-off-by: hzh0425 <642256541@qq.com>
…key ranges (tikv#4215) close tikv#4241 ref pingcap/tidb#28199 Signed-off-by: xhe <xw897002528@gmail.com> Signed-off-by: hzh0425 <642256541@qq.com>
…ikv#4204) * Make the server selection for TSO proxy requests more random (ref tikv#3149) Signed-off-by: JmPotato <ghzpotato@gmail.com> * Refactor the handleDispatcher Signed-off-by: JmPotato <ghzpotato@gmail.com> * Refine the PD client log Signed-off-by: JmPotato <ghzpotato@gmail.com> * Stabilize the test TestGlobalAndLocalTSO Signed-off-by: JmPotato <ghzpotato@gmail.com> * Add function switch Signed-off-by: JmPotato <ghzpotato@gmail.com> * Use Client interface to switch Signed-off-by: JmPotato <ghzpotato@gmail.com> * Address the comment: only update connectionCtxs when it's necessary Signed-off-by: JmPotato <ghzpotato@gmail.com> * Refine the code Signed-off-by: JmPotato <ghzpotato@gmail.com> * Fix the panic Signed-off-by: JmPotato <ghzpotato@gmail.com> * Remove unnecessary changes Signed-off-by: JmPotato <ghzpotato@gmail.com> * Fix a corner case Signed-off-by: JmPotato <ghzpotato@gmail.com> * Re-choose the stream when enableTSOFollowerProxy is disabled Signed-off-by: JmPotato <ghzpotato@gmail.com> * Refine the stream choosing Signed-off-by: JmPotato <ghzpotato@gmail.com> * Refine the code more Signed-off-by: JmPotato <ghzpotato@gmail.com> * Reduce the unnecessary changes Signed-off-by: JmPotato <ghzpotato@gmail.com> * Fix the race Signed-off-by: JmPotato <ghzpotato@gmail.com> * Refine the code Signed-off-by: JmPotato <ghzpotato@gmail.com> * Address the comments to refine the code Signed-off-by: JmPotato <ghzpotato@gmail.com> * Address the comments Signed-off-by: JmPotato <ghzpotato@gmail.com> * Only make the Global TSO watch the updateConnectionCtxsCh Signed-off-by: JmPotato <ghzpotato@gmail.com> * Add connectionCtxs updateTicker Signed-off-by: JmPotato <ghzpotato@gmail.com> * Fix the data race of c.urls Signed-off-by: JmPotato <ghzpotato@gmail.com> * Refine the code Signed-off-by: JmPotato <ghzpotato@gmail.com> Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io> Signed-off-by: hzh0425 <642256541@qq.com>
…ne (tikv#4240) * Introduce ClientOption to configure the PD client (ref tikv#3149) Signed-off-by: JmPotato <ghzpotato@gmail.com> * Refine the code and add some comments Signed-off-by: JmPotato <ghzpotato@gmail.com> * Clean the code Signed-off-by: JmPotato <ghzpotato@gmail.com> * Use a interface method to update the client option Signed-off-by: JmPotato <ghzpotato@gmail.com> * Update the newOption Signed-off-by: JmPotato <ghzpotato@gmail.com> * Remove WithTSOFollowerProxy and WithMaxTSOBatchWaitInterval Signed-off-by: JmPotato <ghzpotato@gmail.com> * Address the comments and refine the test Signed-off-by: JmPotato <ghzpotato@gmail.com> Signed-off-by: hzh0425 <642256541@qq.com>
* core: use previous size if heartbeat's size is zero ref tikv/tikv#11114 Signed-off-by: p4tr1ck <patrick.li@pingcap.com> * add issue link (tikv#4258) Signed-off-by: p4tr1ck <patrick.li@pingcap.com> Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io> Signed-off-by: hzh0425 <642256541@qq.com>
Signed-off-by: nolouch <nolouch@gmail.com> Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io> Signed-off-by: hzh0425 <642256541@qq.com>
* Update TiDB Dashboard to v2021.11.01.1 Signed-off-by: tidb-dashboard-bot <tidb-dashboard-bot@pingcap.com> * ref tikv#4257 Signed-off-by: Breezewish <me@breeswish.org> Co-authored-by: tidb-dashboard-bot <tidb-dashboard-bot@pingcap.com> Co-authored-by: Breezewish <me@breeswish.org> Co-authored-by: 混沌DM <hundundm@gmail.com> Signed-off-by: hzh0425 <642256541@qq.com>
…4271) Signed-off-by: JmPotato <ghzpotato@gmail.com> Signed-off-by: hzh0425 <642256541@qq.com>
Signed-off-by: JmPotato <ghzpotato@gmail.com> Signed-off-by: hzh0425 <642256541@qq.com>
Signed-off-by: Ryan Leung <rleungx@gmail.com> Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io> Signed-off-by: hzh0425 <642256541@qq.com>
* client: refine dynamic option Signed-off-by: HunDunDM <hundundm@gmail.com> * client: refine ticker ref tikv#3149 Signed-off-by: HunDunDM <hundundm@gmail.com> * add comment Signed-off-by: HunDunDM <hundundm@gmail.com> Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io> Signed-off-by: hzh0425 <642256541@qq.com>
Signed-off-by: JmPotato <ghzpotato@gmail.com> Signed-off-by: hzh0425 <642256541@qq.com>
* fix Signed-off-by: lhy1024 <admin@liudos.us> * close tikv#4283 Signed-off-by: lhy1024 <admin@liudos.us> Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io> Signed-off-by: hzh0425 <642256541@qq.com>
close tikv#4257 Signed-off-by: baurine <2008.hbl@gmail.com> Signed-off-by: hzh0425 <642256541@qq.com>
…w-round-by-digit change (tikv#4304) * cluster: fix the bug that region statistics are not updated after flow-round-by-digit change close tikv#4295 Signed-off-by: HunDunDM <hundundm@gmail.com> * refine some code Signed-off-by: HunDunDM <hundundm@gmail.com> * address comment Signed-off-by: HunDunDM <hundundm@gmail.com> Signed-off-by: hzh0425 <642256541@qq.com>
Signed-off-by: Qiang Zhou <zhouqiang.cl@gmail.com> Co-authored-by: disksing <i@disksing.com> Signed-off-by: hzh0425 <642256541@qq.com>
Priority to fit healthy peers. ref tikv#4233 Signed-off-by: sunby <sunbingyi1992@gmail.com> Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io> Signed-off-by: hzh0425 <642256541@qq.com>
update SplitAndScatterRegions Signed-off-by: hzh0425 <642256541@qq.com>
…split_and_scatter # Conflicts: # client/option_test.go # pkg/grpcutil/grpcutil_test.go # server/api/config_test.go # server/api/pprof_test.go # server/cluster/cluster.go # server/cluster/unsafe_recovery_controller.go # server/core/store_test.go # server/encryptionkm/key_manager.go # server/grpc_service.go # server/handler.go # server/schedule/labeler/labeler.go # server/server.go # tests/pdctl/config/config_test.go # tests/server/core/hot_region_storage_test.go
ref: pingcap/tidb#29034
Add a method splitAndScatterRegions in grpc-service
let pd handle split and scatter regions