Add docs for placement rules in SQL#6618
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. DetailsReviewer can indicate their review by submitting an approval review. |
|
@mjonss: Thanks for your review. The bot only counts approvals from reviewers and higher roles in list, but you're still welcome to leave your comments. DetailsIn 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 ti-community-infra/tichi repository. |
There was a problem hiding this comment.
While commenting in the lark, I noticed that some problems are highly confusing. I think the user guide may need a FAQ section.
region/zone/rack/host. What label could be used? Are these 4 special? How isolation applies to these labels(regionis special)?Regionis special that when one region in one rule is failed, other regions will be seen as unavailable. And when PD schedules, it will pick region with higher isolation score first(region has the highest isolation score, host the lowest).- TiFlash banned.
- What if there is some unexpected cases and one of the rules can not be met? It is ignored if it can not be met after posted to PD. PD tries to meet all consontraints in one rule as much as possible.
- If we want to keep the latency low, we must keep the majority in the primary region. That means when we add a new replica somewhere else, we may need another new region in the primary.
- Direct syntax will be converted to a bundle of rules with different role. Sugar will be a bundle of two rules: one for the primary, one for others. And the schedule of PD happens rule by rule, which means the schedule is relatively independent between each role for the direct syntax, but more "smart" for the sugar syntax.
SCHDULEdefaults to 'EVEN'- You can not add 2 replicas on the same tikv/store, for one region. For direct syntax, it means it is impossible to archive 2 replicas with only rule
FOLLOWERS=2, neither possible with{+xx=m:1, +yy=n:1}, if there is only one tikv/store; for sugar syntax, it means you must provide as many tikv/store as the replicas you specify.
I've tried to incorporate some of this feedback, but some we'll have to work on in development (for example: with item 1 - we've not added the zone/rack/host labels yet, but they should have the same place as region does in the current docs).We don't clarify the edge-cases in the docs, but we should in future. |
Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com>
Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com>
Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com>
Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com>
Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com>
Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com>
Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com>
| > | ||
| > Placement Rules in SQL is an experimental feature. The syntax might change before its GA, and there might also be bugs. | ||
| > | ||
| > If you understand the risks, you can enable this experiment feature by executing `SET GLOBAL tidb_enable_alter_placement = 1;`. |
There was a problem hiding this comment.
Can we add a note like:
We recommend using this feature with the help of the official tidb team to help solve specific scenarios. Over-configuration of the placement plan will increase the difficulty of maintenance and troubleshooting, so reasonable planning is very necessary. Usually, the points that need to be considered, including disaster recovery issues, high availability issues, performance issues and so on.
There was a problem hiding this comment.
Hi @nolouch. Some comments in line:
We recommend using this feature with the help of the official tidb team to help solve specific scenarios. Over-configuration of the placement plan will increase the difficulty of maintenance and troubleshooting, so reasonable planning is very necessary.
To a large degree we removed over configuration as a possibility between the original proposal and the newer proposal. You can no longer specify multiple constraints; and syntactic sugar constraints are mutually exclusive with regular constraints. The only complex scenarios that remain are both FOLLOWER_CONSTRAINTS and CONSTRAINTS can apply, and a user could set a complex constraint in dictionary format.
Usually, the points that need to be considered, including disaster recovery issues, high availability issues, performance issues and so on.
We don't document this well in the current experimental version. Because it is experimental, users are not encouraged to use it in production, so high availability/DR did not seem relevant (yet).
I have an alternative suggestion:
We value your feedback when evaluating experimental features. Please feel free to create a GitHub issue or reach out to us on TiDB Slack. We are interested to both the problems you encounter and your intended use-cases.
|
/remove-status LGT1 |
|
/merge |
|
@nolouch: Thanks for your review. The bot only counts approvals from reviewers and higher roles in list, but you're still welcome to leave your comments. DetailsIn 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 ti-community-infra/tichi repository. |
|
This pull request has been accepted and is ready to merge. DetailsCommit hash: 5422310 |
| @@ -287,6 +288,7 @@ | |||
| + [`CREATE [GLOBAL|SESSION] BINDING`](/sql-statements/sql-statement-create-binding.md) | |||
| + [`CREATE DATABASE`](/sql-statements/sql-statement-create-database.md) | |||
| + [`CREATE INDEX`](/sql-statements/sql-statement-create-index.md) | |||
There was a problem hiding this comment.
Some newly added documents are missing in the TOC. They are added in #6766.
What is changed, added or deleted? (Required)
This provides docs for placement rules, a 5.3 experimental feature. It is still a work in progress, I'm publishing so I can get feedback from others.
Which TiDB version(s) do your changes apply to? (Required)
Tips for choosing the affected version(s):
By default, CHOOSE MASTER ONLY so your changes will be applied to the next TiDB major or minor releases. If your PR involves a product feature behavior change or a compatibility change, CHOOSE THE AFFECTED RELEASE BRANCH(ES) AND MASTER.
For details, see tips for choosing the affected versions.
What is the related PR or file link(s)?
Docs for pingcap/tidb#18030
Do your changes match any of the following descriptions?