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

remove direct placement #7400

Merged
merged 13 commits into from
Mar 9, 2022
Merged

Conversation

morgo
Copy link
Contributor

@morgo morgo commented Jan 12, 2022

What is changed, added or deleted? (Required)

This updates the docs for a removed feature in master (direct placement)

Closes pingcap/tidb#31486
Closes pingcap/tidb#31559
Closes pingcap/tidb#31487

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)
  • 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)?

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

@morgo morgo requested a review from xhebox January 12, 2022 17:03
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Jan 12, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • TomShawn

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/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 12, 2022
@shichun-0415 shichun-0415 added the area/sql-infra Indicates that the Issue or PR belongs to the area of sql-infra and sql-metadata. label Jan 13, 2022
@shichun-0415 shichun-0415 added the translation/doing This PR's assignee is translating this PR. label Jan 13, 2022
@ti-chi-bot ti-chi-bot removed the missing-translation-status This PR does not have translation status info. label Jan 13, 2022
@shichun-0415 shichun-0415 requested a review from TomShawn January 13, 2022 11:20
@TomShawn TomShawn added for-future-release This PR only applies to master for now and might cherry-pick to a future release. type/compatibility-or-feature-change This PR involves compatibility changes or feature behavior changes. labels Jan 14, 2022
@morgo
Copy link
Contributor Author

morgo commented Jan 25, 2022

In 8ea693d I renamed DirectPlacementOption to PlacementOption because it is less confusing, but for historical purposes in the parser code it is still called DirectPlacementOption. I think this is okay.

Currently, the Synopsis does not convey that certain options are required together (i.e. regions + primary_region). I don't have any easy ideas on how to resolve that. At least from an error message and examples perspective this should be intuitive.

@morgo morgo requested a review from lcwangchao January 25, 2022 03:35
Copy link
Contributor

@xhebox xhebox left a comment

Choose a reason for hiding this comment

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

LGTM otherwise

sql-statements/sql-statement-show-placement.md Outdated Show resolved Hide resolved
sql-statements/sql-statement-show-placement-for.md Outdated Show resolved Hide resolved
@TomShawn TomShawn assigned xhebox and unassigned TomShawn Jan 25, 2022
@xhebox xhebox mentioned this pull request Jan 26, 2022
15 tasks
@@ -23,11 +23,11 @@ PolicyName ::=
Identifier

PlacementOptionList ::=
DirectPlacementOption
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we do this:

PlacementOptionList ::=
     PlacementSugarSyntaxOptionList
   | PlacementNoSugarSyntaxOptionList

PlacementSugarSyntaxOptionList ::= "PRIMARY_REGION" EqOpt stringLit "REGIONS" EqOpt stringLit ...

User can easily learn how to write a right 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.

Sure

placement-rules-in-sql.md Outdated Show resolved Hide resolved
placement-rules-in-sql.md Outdated Show resolved Hide resolved
placement-rules-in-sql.md Outdated Show resolved Hide resolved
placement-rules-in-sql.md Outdated Show resolved Hide resolved
placement-rules-in-sql.md Outdated Show resolved Hide resolved
placement-rules-in-sql.md Outdated Show resolved Hide resolved
sql-statements/sql-statement-alter-placement-policy.md Outdated Show resolved Hide resolved
sql-statements/sql-statement-show-placement-for.md Outdated Show resolved Hide resolved
@TomShawn
Copy link
Contributor

TomShawn commented Mar 4, 2022

@morgo If Placement Rules in SQL is going to be GA in v6.0, shall we delete the experimental warning at Line 10?

@morgo
Copy link
Contributor Author

morgo commented Mar 4, 2022

@morgo If Placement Rules in SQL is going to be GA in v6.0, shall we delete the experimental warning at Line 10?

Yes. We can do it in this PR or a different PR (my preference), but either way works.

@TomShawn TomShawn self-assigned this Mar 7, 2022
@TomShawn
Copy link
Contributor

TomShawn commented Mar 7, 2022

If removing the experimental warning is the only thing to do for the v6.0 documentation, I might prefer doing it in this PR. Anyway, either way works for me, too.

@TomShawn TomShawn removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 7, 2022
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

@morgo
Copy link
Contributor Author

morgo commented Mar 7, 2022

/merge

@ti-chi-bot
Copy link
Member

@morgo: /merge in this pull request requires 2 approval(s).

In response to this:

/merge

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.

@TomShawn TomShawn removed the v6.0 This PR/issue applies to TiDB v6.0. label Mar 9, 2022
@TomShawn
Copy link
Contributor

TomShawn commented Mar 9, 2022

/remove-status LGT1
/status LGT2

@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 9, 2022
@TomShawn
Copy link
Contributor

TomShawn commented Mar 9, 2022

/merge

@ti-chi-bot
Copy link
Member

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

Commit hash: 01062cf

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Mar 9, 2022
@TomShawn TomShawn added v6.0 This PR/issue applies to TiDB v6.0. translation/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR. and removed translation/doing This PR's assignee is translating this PR. labels Mar 9, 2022
@TomShawn TomShawn merged commit 5df282c into pingcap:master Mar 9, 2022
@TomShawn
Copy link
Contributor

TomShawn commented Mar 9, 2022

@morgo There are still another 11 "placement options" in placement-rules-in-sql.md. Do they need to be modified, or kept as they are?

@@ -13,6 +13,13 @@ summary: The usage of ALTER PLACEMENT POLICY in TiDB.

`ALTER PLACEMENT POLICY` is used to modify existing placement policies that have previously been created. All the tables and partitions which use the placement policy will automatically be updated.

`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:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
`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:
`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 overwritten by the `ALTER PLACEMENT POLICY` statement:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"lost" is more clear here, because it was not specified (overwritten) in the ALTER statement.

@@ -11,7 +11,13 @@ summary: The usage of SHOW PLACEMENT FOR in TiDB.
>
> If you understand the risks, you can enable this experiment feature by executing `SET GLOBAL tidb_enable_alter_placement = 1;`.

`SHOW PLACEMENT FOR` summarizes all placement options from direct placement and placement policies, and presents them in the canonical form for a specific table, database schema, or partition.
`SHOW PLACEMENT FOR` summarizes all placement options, and presents them in the canonical form for a specific table, database schema, or partition.
Copy link
Contributor

@TomShawn TomShawn Mar 9, 2022

Choose a reason for hiding this comment

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

placement options, policies, or rules? The [docs-cn PR] uses 'placement policy' but translated as 'placement rules'. I am a bit confused. See https://github.com/pingcap/docs-cn/pull/8230/files#diff-439cd260163b3aaafae1cb9ac228dc2343f5ee9c23a9211fdb2c6168ea5c08beR12.
@xhebox @morgo

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  • A placement OPTION is something like "FOLLOWERS=4".
  • A placement POLICY is a way of grouping options together into a named object which can be assigned to tables.
  • Placement RULES previously included both direct placement options and placement policies, but we've since removed direct placement so this term has lost much of its meaning. So it is now usually possible to use RULES and POLICY interchangably, but I think we should keep the terms for now because it is similar to using the terms "RBAC" and "permissions" interchangebly. "Policy" is like the RBAC of Placement.


The statement returns a result set in which the `Scheduling_State` field indicates the current progress that the Placement Driver (PD) has made in scheduling the placement:

* `PENDING`: The PD has not yet started scheduling the placement. This might indicate that that the placement rules are semantically correct, but can not currently be satisfied by the cluster. For example, if `FOLLOWERS=4` but there are only 3 TiKV stores which are candidates for followers.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* `PENDING`: The PD has not yet started scheduling the placement. This might indicate that that the placement rules are semantically correct, but can not currently be satisfied by the cluster. For example, if `FOLLOWERS=4` but there are only 3 TiKV stores which are candidates for followers.
* `PENDING`: The PD has not yet started scheduling the placement. This might indicate that the placement rules are semantically correct, but cannot currently be satisfied by the cluster. For example, if `FOLLOWERS=4` but there are only 3 TiKV stores that are candidates for followers.

@TomShawn TomShawn added the requires-followup This PR requires a follow-up task after being merged. label Mar 9, 2022
@morgo morgo mentioned this pull request Mar 9, 2022
15 tasks
@morgo
Copy link
Contributor Author

morgo commented Mar 9, 2022

I have created #7814 for followup

@morgo morgo deleted the remove-direct-placement branch March 9, 2022 19:29
@TomShawn TomShawn removed the requires-followup This PR requires a follow-up task after being merged. label Mar 14, 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/L Denotes a PR that changes 100-499 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
6 participants