Skip to content
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

*: refine placement documents #7885

Merged
merged 19 commits into from
Mar 23, 2022
Merged

*: refine placement documents #7885

merged 19 commits into from
Mar 23, 2022

Conversation

xhebox
Copy link
Contributor

@xhebox xhebox commented Mar 18, 2022

Signed-off-by: xhe [email protected]

First-time contributors' checklist

What is changed, added or deleted? (Required)

  1. Address remove direct placement docs-cn#8230 (comment), rename PLACEMENT_RULES table.
  2. Address remove direct placement docs-cn#8230 (comment), restructure syntax tree
  3. Remove VOTERS as the implementation
  4. Refines on the introduction page, changes are marked out

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.

  • master (the latest development version)
  • v6.0 (TiDB 6.0 versions)
  • v5.4 (TiDB 5.4 versions)
  • v5.3 (TiDB 5.3 versions)
  • v5.2 (TiDB 5.2 versions)
  • v5.1 (TiDB 5.1 versions)
  • v5.0 (TiDB 5.0 versions)
  • v4.0 (TiDB 4.0 versions)
  • v3.1 (TiDB 3.1 versions)
  • v3.0 (TiDB 3.0 versions)
  • v2.1 (TiDB 2.1 versions)

What is the related PR or file link(s)?

  • This PR is translated from:
  • Other reference link(s):

Do your changes match any of the following descriptions?

  • Delete files
  • Change aliases
  • Need modification after applied to another branch
  • Might cause conflicts after applied to another branch

@xhebox xhebox requested review from morgo and TomShawn March 18, 2022 07:25
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Mar 18, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • TomShawn
  • morgo

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added missing-translation-status This PR does not have translation status info. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Mar 18, 2022

`ALTER PLACEMENT POLICY` _replaces_ the previous policy with the new definition. It does not _merge_ the old policy with the new one. In the following example, `FOLLOWERS=4` is lost when the `ALTER PLACEMENT POLICY` is executed:

```sql
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to Examples section

Comment on lines 44 to 54
It is also possible to alter placement policies by [`ALTER PLACEMENT POLICY`](/sql-statements/sql-statement-alter-placement-policy.md), and the changes will propagate to all objects with the corresponding policy.

```sql
ALTER PLACEMENT POLICY myplacementpolicy FOLLOWERS=5;
```

Finally, you can use [`DROP PLACEMENT POLICY`](/sql-statements/sql-statement-drop-placement-policy.md) to drop policies that are not attached to any table or partition:

```sql
DROP PLACEMENT POLICY myplacementpolicy;
```
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional entry for ALTER and DROP.

placement-rules-in-sql.md Outdated Show resolved Hide resolved
@@ -99,8 +131,12 @@ In addition to the placement options above, you can also use the advance configu

| Option Name | Description |
| --------------| ------------ |
| `CONSTRAINTS` | A list of constraints that apply to all roles. For example, `CONSTRAINTS="[+disk=ssd]`. |
| `FOLLOWER_CONSTRAINTS` | A list of constraints that only apply to followers. |
| `CONSTRAINTS` | A list of constraints that apply to all roles. For example, `CONSTRAINTS="[+disk=ssd]`. |
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Complete list of advanced constraints

placement-rules-in-sql.md Outdated Show resolved Hide resolved
@@ -174,7 +214,7 @@ CREATE TABLE t4 (a INT); -- Creates a table t4 with the default policy p3.
ALTER PLACEMENT POLICY p3 FOLLOWERS=3; -- The table with policy p3 (t4) will have FOLLOWERS=3.
```

You can use [`ALTER PLACEMENT POLICY`](/sql-statements/sql-statement-alter-placement-policy.md) to change a policy, and the changes will propagate to all objects with the corresponding policy.
Note that this is different from inheritance between partitions and tables, where changing policy of tables will effect their partitions. Tables only inherit the policy of schema when it is created without attaching policies.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move ALTER in the above section, and clarify inheritance between partition/table, table/schema

@shichun-0415 shichun-0415 added translation/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR. area/sql-infra Indicates that the Issue or PR belongs to the area of sql-infra and sql-metadata. and removed missing-translation-status This PR does not have translation status info. labels Mar 18, 2022
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Mar 18, 2022
@TomShawn TomShawn added the v6.0 This PR/issue applies to TiDB v6.0. label Mar 21, 2022
@TomShawn
Copy link
Contributor

/rebase

Copy link
Contributor

@TomShawn TomShawn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly minor edits in line

br/backup-and-restore-tool.md Outdated Show resolved Hide resolved
information-schema/information-schema.md Outdated Show resolved Hide resolved
sql-statements/sql-statement-alter-placement-policy.md Outdated Show resolved Hide resolved
sql-statements/sql-statement-alter-placement-policy.md Outdated Show resolved Hide resolved
system-variables.md Outdated Show resolved Hide resolved
system-variables.md Outdated Show resolved Hide resolved
system-variables.md Outdated Show resolved Hide resolved
Copy link
Contributor

@TomShawn TomShawn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Mar 23, 2022
@TomShawn
Copy link
Contributor

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: 8b7d130

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Mar 23, 2022
@TomShawn TomShawn added the type/compatibility-or-feature-change This PR involves compatibility changes or feature behavior changes. label Mar 23, 2022
@TomShawn TomShawn merged commit 91fe4b0 into pingcap:master Mar 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/sql-infra Indicates that the Issue or PR belongs to the area of sql-infra and sql-metadata. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. translation/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR. type/compatibility-or-feature-change This PR involves compatibility changes or feature behavior changes. v6.0 This PR/issue applies to TiDB v6.0.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants