-
Notifications
You must be signed in to change notification settings - Fork 687
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
remove direct placement #7400
Changes from all commits
779279c
8ea693d
cf1f477
b7cbbf8
114c573
d97d0dd
4b4f8e2
aabc310
27e22a8
e4098fa
d38c515
4f395fc
01062cf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,11 +23,11 @@ PolicyName ::= | |
Identifier | ||
|
||
PlacementOptionList ::= | ||
DirectPlacementOption | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we do this:
User can easily learn how to write a right sql There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure |
||
| PlacementOptionList DirectPlacementOption | ||
| PlacementOptionList ',' DirectPlacementOption | ||
PlacementOption | ||
| PlacementOptionList PlacementOption | ||
| PlacementOptionList ',' PlacementOption | ||
|
||
DirectPlacementOption ::= | ||
PlacementOption ::= | ||
"PRIMARY_REGION" EqOpt stringLit | ||
| "REGIONS" EqOpt stringLit | ||
| "FOLLOWERS" EqOpt LengthNum | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -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. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||
|
||||||
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. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
* `INPROGRESS`: The PD is currently scheduling the placement. | ||||||
* `SCHEDULED`: The PD has successfully scheduled the placement. | ||||||
|
||||||
## Synopsis | ||||||
|
||||||
|
@@ -34,14 +40,11 @@ CREATE PLACEMENT POLICY p1 PRIMARY_REGION="us-east-1" REGIONS="us-east-1,us-west | |||||
use test; | ||||||
ALTER DATABASE test PLACEMENT POLICY=p1; | ||||||
CREATE TABLE t1 (a INT); | ||||||
CREATE TABLE t2 (a INT) PRIMARY_REGION="us-east-1" REGIONS="us-east-1,us-west-1" FOLLOWERS=4; | ||||||
SHOW PLACEMENT FOR DATABASE test; | ||||||
SHOW PLACEMENT FOR TABLE t1; | ||||||
SHOW CREATE TABLE t1\G | ||||||
SHOW PLACEMENT FOR TABLE t2; | ||||||
CREATE TABLE t3 (a INT) PARTITION BY RANGE (a) (PARTITION p1 VALUES LESS THAN (10), PARTITION p2 VALUES LESS THAN (20) FOLLOWERS=4); | ||||||
CREATE TABLE t3 (a INT) PARTITION BY RANGE (a) (PARTITION p1 VALUES LESS THAN (10), PARTITION p2 VALUES LESS THAN (20)); | ||||||
SHOW PLACEMENT FOR TABLE t3 PARTITION p1; | ||||||
SHOW PLACEMENT FOR TABLE t3 PARTITION p2; | ||||||
``` | ||||||
|
||||||
``` | ||||||
|
@@ -74,28 +77,12 @@ Create Table: CREATE TABLE `t1` ( | |||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin /*T![placement] PLACEMENT POLICY=`p1` */ | ||||||
1 row in set (0.00 sec) | ||||||
|
||||||
+---------------+----------------------------------------------------------------------+------------------+ | ||||||
| Target | Placement | Scheduling_State | | ||||||
+---------------+----------------------------------------------------------------------+------------------+ | ||||||
| TABLE test.t2 | PRIMARY_REGION="us-east-1" REGIONS="us-east-1,us-west-1" FOLLOWERS=4 | INPROGRESS | | ||||||
+---------------+----------------------------------------------------------------------+------------------+ | ||||||
1 row in set (0.00 sec) | ||||||
|
||||||
Query OK, 0 rows affected (0.14 sec) | ||||||
|
||||||
+----------------------------+-----------------------------------------------------------------------+------------------+ | ||||||
| Target | Placement | Scheduling_State | | ||||||
+----------------------------+-----------------------------------------------------------------------+------------------+ | ||||||
| TABLE test.t3 PARTITION p1 | PRIMARY_REGION="us-east-1" REGIONS="us-east-1,,us-west-1" FOLLOWERS=4 | INPROGRESS | | ||||||
+----------------------------+-----------------------------------------------------------------------+------------------+ | ||||||
1 row in set (0.00 sec) | ||||||
|
||||||
+----------------------------+-------------+------------------+ | ||||||
| Target | Placement | Scheduling_State | | ||||||
+----------------------------+-------------+------------------+ | ||||||
| TABLE test.t3 PARTITION p2 | FOLLOWERS=4 | INPROGRESS | | ||||||
+----------------------------+-------------+------------------+ | ||||||
1 row in set (0.00 sec) | ||||||
``` | ||||||
|
||||||
## MySQL compatibility | ||||||
|
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.
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.
"lost" is more clear here, because it was not specified (overwritten) in the ALTER statement.