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 rule in sql docs #15190

Merged
merged 69 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from 46 commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
83c5af4
*: refine placement rule in sql
nolouch Oct 12, 2023
58ff756
fix
nolouch Oct 17, 2023
e025712
Update placement-rules-in-sql.md
nolouch Oct 17, 2023
b14461f
fix
nolouch Oct 17, 2023
13bfbfe
fix
nolouch Oct 17, 2023
6b6206d
replace rule to policy
nolouch Oct 18, 2023
233fde7
address
nolouch Oct 18, 2023
731db43
address
nolouch Oct 25, 2023
e9156ba
Update placement-rules-in-sql.md
nolouch Oct 25, 2023
1b50d02
address
nolouch Oct 25, 2023
c4cc258
Merge remote-tracking branch 'nolouch/improve-ruleinsql' into improve…
nolouch Oct 25, 2023
555013f
refine the structure and descriptions
qiancai Oct 26, 2023
716e7ee
Update placement-rules-in-sql.md
qiancai Oct 27, 2023
203c6af
Update placement-rules-in-sql.md
nolouch Oct 27, 2023
73a5e05
Update placement-rules-in-sql.md
nolouch Oct 27, 2023
35a7363
Update placement-rules-in-sql.md
nolouch Oct 27, 2023
c40f08a
Update placement-rules-in-sql.md
nolouch Oct 27, 2023
75f8c8b
Update placement-rules-in-sql.md
nolouch Oct 27, 2023
2906f13
Update placement-rules-in-sql.md
nolouch Oct 27, 2023
f2e63b8
Update placement-rules-in-sql.md
nolouch Oct 27, 2023
7163311
Update placement-rules-in-sql.md
nolouch Oct 27, 2023
a173123
Update placement-rules-in-sql.md
nolouch Oct 27, 2023
8cc7418
Update placement-rules-in-sql.md
nolouch Oct 27, 2023
ace7e72
fix a broken link
qiancai Oct 27, 2023
a220ee7
update
nolouch Oct 27, 2023
6e18cfe
Merge remote-tracking branch 'nolouch/improve-ruleinsql' into improve…
nolouch Oct 27, 2023
167e67c
Update placement-rules-in-sql.md
nolouch Oct 27, 2023
1b5997f
Update placement-rules-in-sql.md
nolouch Oct 27, 2023
512cfe6
Update placement-rules-in-sql.md
nolouch Oct 27, 2023
00b3e5e
update
nolouch Oct 27, 2023
3c84fc8
Merge remote-tracking branch 'nolouch/improve-ruleinsql' into improve…
nolouch Oct 27, 2023
bf4e48e
update
nolouch Oct 27, 2023
8b90b01
Update placement-rules-in-sql.md
nolouch Oct 27, 2023
b052fc0
Update placement-rules-in-sql.md
nolouch Oct 30, 2023
e946a2f
Update sql-statements/sql-statement-alter-range.md
nolouch Oct 30, 2023
840ebce
Update placement-rules-in-sql.md
nolouch Oct 30, 2023
d380d85
Update sql-statements/sql-statement-alter-range.md
nolouch Oct 30, 2023
a0fcdb4
Update sql-statements/sql-statement-alter-range.md
nolouch Oct 30, 2023
9a113da
Update sql-statements/sql-statement-alter-range.md
nolouch Oct 30, 2023
593b606
address
nolouch Oct 30, 2023
f732d26
Update placement-rules-in-sql.md
nolouch Oct 30, 2023
7192c5e
Update placement-rules-in-sql.md
nolouch Oct 30, 2023
594394d
Update placement-rules-in-sql.md
nolouch Oct 30, 2023
8034385
Update placement-rules-in-sql.md
nolouch Oct 30, 2023
cb39593
address
nolouch Oct 30, 2023
3ec9f49
Merge remote-tracking branch 'nolouch/improve-ruleinsql' into improve…
nolouch Oct 30, 2023
e9285bb
Update placement-rules-in-sql.md
nolouch Oct 30, 2023
5331b15
Update placement-rules-in-sql.md
nolouch Nov 7, 2023
e6ae990
Update placement-rules-in-sql.md
nolouch Nov 7, 2023
c9dcdb2
Update placement-rules-in-sql.md
nolouch Nov 7, 2023
4a9d4ab
Update sql-statements/sql-statement-alter-range.md
nolouch Nov 7, 2023
c7526b7
Update sql-statements/sql-statement-alter-range.md
nolouch Nov 7, 2023
f492461
Update placement-rules-in-sql.md
nolouch Nov 7, 2023
0b86405
Update placement-rules-in-sql.md
nolouch Nov 7, 2023
8c44732
Update placement-rules-in-sql.md
nolouch Nov 7, 2023
8bd7285
Update placement-rules-in-sql.md
nolouch Nov 7, 2023
273aa78
Update placement-rules-in-sql.md
nolouch Nov 7, 2023
e810196
Update placement-rules-in-sql.md
nolouch Nov 7, 2023
e8b00ac
Update placement-rules-in-sql.md
nolouch Nov 7, 2023
35b7047
Update placement-rules-in-sql.md
nolouch Nov 7, 2023
2c7bc62
Update placement-rules-in-sql.md
nolouch Nov 7, 2023
b1baeaf
Update placement-rules-in-sql.md
nolouch Nov 7, 2023
19be375
Update placement-rules-in-sql.md
nolouch Nov 7, 2023
56251bf
address
nolouch Nov 7, 2023
5a7eaa2
fix format issues
qiancai Nov 7, 2023
32865e6
Update sql-statements/sql-statement-alter-range.md
nolouch Nov 8, 2023
26c3bb8
Update sql-statements/sql-statement-alter-range.md
nolouch Nov 8, 2023
a9b9d5a
Update release-6.3.0.md
qiancai Nov 8, 2023
6d72524
Update placement-rules-in-sql.md
qiancai Nov 8, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions TOC.md
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,7 @@
- [`ALTER TABLE`](/sql-statements/sql-statement-alter-table.md)
- [`ALTER TABLE COMPACT`](/sql-statements/sql-statement-alter-table-compact.md)
- [`ALTER USER`](/sql-statements/sql-statement-alter-user.md)
- [`ALTER RANGE`](/sql-statements/sql-statement-alter-range.md)
Copy link
Collaborator

@qiancai qiancai Nov 2, 2023

Choose a reason for hiding this comment

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

按字母顺序排列,需要放到 ALTER RESOURCE GROUP 前面

- [`ANALYZE TABLE`](/sql-statements/sql-statement-analyze-table.md)
- [`BACKUP`](/sql-statements/sql-statement-backup.md)
- [`BATCH`](/sql-statements/sql-statement-batch.md)
Expand Down
473 changes: 314 additions & 159 deletions placement-rules-in-sql.md

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions releases/release-6.6.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ TiDB 版本:6.6.0-[DMR](/releases/versioning.md#开发里程碑版本)
- 对于跨云区域部署的 TiDB 集群,当某个云区域产生故障时,指定数据库或表能在另一个云区域继续提供服务。
- 对于单个云区域内部署的 TiDB 集群,当某个可用区产生故障时,指定数据库或表能在另一个可用区继续提供服务。

更多信息,请参考[用户文档](/placement-rules-in-sql.md#生存偏好)。
更多信息,请参考[用户文档](/placement-rules-in-sql.md#指定生存偏好)。

* 支持通过 `FLASHBACK CLUSTER TO TIMESTAMP` 命令闪回 DDL 操作 [#14088](https://github.com/tikv/tikv/issues/14045) @[Defined2014](https://github.com/Defined2014) @[JmPotato](https://github.com/JmPotato)

Expand Down Expand Up @@ -218,7 +218,7 @@ TiDB 版本:6.6.0-[DMR](/releases/versioning.md#开发里程碑版本)

更多信息,请参考[用户文档](/tidb-lightning/tidb-lightning-configuration.md#tidb-lightning-任务配置)。

- TiDB Lightning 向 TiKV 传输键值对时支持启用压缩传输 [#41163](https://github.com/pingcap/tidb/issues/41163) @[gozssky](https://github.com/gozssky)
- TiDB Lightning 向 TiKV 传输键值对时支持启用压缩传输 [#41163](https://github.com/pingcap/tidb/issues/41163) @[sleepymole](https://github.com/sleepymole)

自 v6.6.0 起,TiDB Lightning 支持将本地编码排序后的键值对在网络传输时进行压缩再发送到 TiKV,从而减少网络传输的数据量,降低网络带宽开销。之前版本不支持该功能,在数据量较大的情况下,TiDB Lightning 对网络带宽要求相对较高,且会产生较高的流量费。

Expand Down Expand Up @@ -484,7 +484,7 @@ TiDB 版本:6.6.0-[DMR](/releases/versioning.md#开发里程碑版本)
- 支持通过 `lightning.max-error` 设置最大冲突个数 [#40743](https://github.com/pingcap/tidb/issues/40743) @[dsdashun](https://github.com/dsdashun)
- 支持导入带有 BOM header 的 CSV 数据文件 [#40744](https://github.com/pingcap/tidb/issues/40744) @[dsdashun](https://github.com/dsdashun)
- 优化遇到 TiKV 限流错误时的处理逻辑,改为尝试其他空闲的 Region [#40205](https://github.com/pingcap/tidb/issues/40205) @[lance6716](https://github.com/lance6716)
- 导入时关闭对表外键的检查 [#40027](https://github.com/pingcap/tidb/issues/40027) @[gozssky](https://github.com/gozssky)
- 导入时关闭对表外键的检查 [#40027](https://github.com/pingcap/tidb/issues/40027) @[sleepymole](https://github.com/sleepymole)

+ Dumpling

Expand Down Expand Up @@ -597,7 +597,7 @@ TiDB 版本:6.6.0-[DMR](/releases/versioning.md#开发里程碑版本)
- 修复在并行导入时,当除最后一个 TiDB Lightning 实例外的其他实例都遇到本地重复记录时,TiDB Lightning 可能会错误地跳过冲突处理的问题 [#40923](https://github.com/pingcap/tidb/issues/40923) @[lichunzhu](https://github.com/lichunzhu)
- 修复 precheck 无法准确检测目标集群是否存在运行中的 TiCDC 的问题 [#41040](https://github.com/pingcap/tidb/issues/41040) @[lance6716](https://github.com/lance6716)
- 修复 TiDB Lightning 在 split-region 阶段发生 panic 的问题 [#40934](https://github.com/pingcap/tidb/issues/40934) @[lance6716](https://github.com/lance6716)
- 修复冲突处理逻辑 (`duplicate-resolution`) 可能导致 checksum 不一致的问题 [#40657](https://github.com/pingcap/tidb/issues/40657) @[gozssky](https://github.com/gozssky)
- 修复冲突处理逻辑 (`duplicate-resolution`) 可能导致 checksum 不一致的问题 [#40657](https://github.com/pingcap/tidb/issues/40657) @[sleepymole](https://github.com/sleepymole)
- 修复当数据文件中存在未闭合的 delimiter 时可能 OOM 的问题 [#40400](https://github.com/pingcap/tidb/issues/40400) @[buchuitoudegou](https://github.com/buchuitoudegou)
- 修复报错中的文件 offset 超过文件大小的问题 [#40034](https://github.com/pingcap/tidb/issues/40034) @[buchuitoudegou](https://github.com/buchuitoudegou)
- 修复新版 PD client 可能导致并行导入失败的问题 [#40493](https://github.com/pingcap/tidb/issues/40493) @[AmoebaProtozoa](https://github.com/AmoebaProtozoa)
Expand Down
1 change: 1 addition & 0 deletions sql-statements/sql-statement-alter-placement-policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ AdvancedPlacementOption ::=
| "LEADER_CONSTRAINTS" EqOpt stringLit
| "FOLLOWER_CONSTRAINTS" EqOpt stringLit
| "LEARNER_CONSTRAINTS" EqOpt stringLit
| "SURVIVAL_PREFERENCES" EqOpt stringLit
```

## 示例
Expand Down
32 changes: 32 additions & 0 deletions sql-statements/sql-statement-alter-range.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
title: ALTER RANGE
summary: TiDB 数据库中 ALTER RANGE 的使用概况。
---

hfxsd marked this conversation as resolved.
Show resolved Hide resolved
# ALTER RANGE

`ALTER RANGE` 语句目前仅用于修改 TiDB 数据库中指定范围的放置策略。

## 语法图

```ebnf+diagram
AlterRangeStmt ::=
'ALTER' 'RANGE' Identifier PlacementPolicyOption
```

目前 `ALTER RANGE` 能起作用的有 `global` 和 `meta` 两个参数:

- `global`: 表示集群内全域数据的范围
- `meta`: 表示 TiDB 内部存储的元信息的数据范围
nolouch marked this conversation as resolved.
Show resolved Hide resolved

## 示例
nolouch marked this conversation as resolved.
Show resolved Hide resolved

```sql
CREATE PLACEMENT POLICY `deploy111` CONSTRAINTS='{"+region=us-east-1":1, "+region=us-east-2": 1, "+region=us-west-1": 1}';
CREATE PLACEMENT POLICY `five_replicas` FOLLOWERS=4;

ALTER RANGE global PLACEMENT POLICY = "deploy221";
nolouch marked this conversation as resolved.
Show resolved Hide resolved
ALTER RANGE global PLACEMENT POLICY = "five_replicas";
nolouch marked this conversation as resolved.
Show resolved Hide resolved
```

上述示例创建了一个名为 `deploy221` 和 `five_replicas` 的放置策略,为不同的区域指定了约束条件。然后将 `deploy111` 放置策略应用到了整个集群范围内的数据,将 `five_replicas` 放置策略应用到元数据范围内。
nolouch marked this conversation as resolved.
Show resolved Hide resolved
1 change: 1 addition & 0 deletions sql-statements/sql-statement-create-placement-policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ AdvancedPlacementOption ::=
| "LEADER_CONSTRAINTS" EqOpt stringLit
| "FOLLOWER_CONSTRAINTS" EqOpt stringLit
| "LEARNER_CONSTRAINTS" EqOpt stringLit
| "SURVIVAL_PREFERENCES" EqOpt stringLit
```

## 示例
Expand Down