-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Update bdr mode && add description related bdr sql #15865
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
Merged
Merged
Changes from 27 commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
0ffdd1a
add bdr role sql
okJiang 6b27301
Merge branch 'master' of https://github.com/pingcap/docs-cn into bdr
okJiang 4d0c786
update bdr mode
okJiang 8a24cbd
Merge remote-tracking branch 'upstream/master' into pr/15865
hfxsd b3e2255
Update TOC.md
hfxsd 4b699ae
Update BDR role options and DDL synchronization
okJiang e080a35
Merge branch 'bdr' of https://github.com/okJiang/docs-cn into bdr
okJiang 1b71759
Add error code 8263 and update documentation
okJiang a862d01
fix comment: Add warning about experimental feature in BDR role docum…
okJiang ed64cf0
refined wording
hfxsd 47e6d03
Update ticdc-bidirectional-replication.md
hfxsd cb01581
Update sql-statement-admin-bdr-role.md
hfxsd 954bf71
Update sql-statement-admin-bdr-role.md
hfxsd 2ef2722
Update sql-statement-admin-bdr-role.md
hfxsd ce4da0e
Update ticdc-bidirectional-replication.md
hfxsd f61d2e5
Update ticdc/ticdc-bidirectional-replication.md
okJiang f80bba7
Update ticdc-bidirectional-replication.md
hfxsd 716dabb
Merge branch 'bdr' of https://github.com/okJiang/docs-cn into pr/15865
hfxsd 7950fa3
Update ticdc-bidirectional-replication.md
hfxsd 052331c
add auto_increment
okJiang 9db5f43
Merge branch 'bdr' of https://github.com/okJiang/docs-cn into bdr
okJiang 937c74b
typop
okJiang 1287313
Apply suggestions from code review
hfxsd 21cb817
Apply suggestions from code review
hfxsd 2fedc2e
change set bdr role local_only to unset bdr role
okJiang 336cb8c
Merge branch 'bdr' of https://github.com/okJiang/docs-cn into bdr
okJiang 1a422c9
Apply suggestions from code review
hfxsd 96ddd8a
Apply suggestions from code review
okJiang 3d256f1
Update ticdc/ticdc-bidirectional-replication.md
okJiang 9747871
Update ticdc/ticdc-bidirectional-replication.md
okJiang cbcb40b
Apply suggestions from code review
okJiang 997a42b
Apply suggestions from code review
hfxsd 3008af6
Update ticdc/ticdc-bidirectional-replication.md
hfxsd 77b0f10
Apply suggestions from code review
hfxsd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
--- | ||
title: ADMIN [SET|SHOW|UNSET] BDR ROLE | ||
summary: TiDB 数据库中 ADMIN [SET|SHOW|UNSET] BDR ROLE 的使用概况。 | ||
--- | ||
|
||
# ADMIN [SET|SHOW|UNSET] BDR ROLE | ||
|
||
- `ADMIN SET BDR ROLE` 可以设置该集群的 BDR role。现在 TiDB 集群可以设置 `PRIMARY`、`SECONDARY` 两种 BDR role。关于 BDR role 的详细信息可参考 [TiCDC 双向复制的 DDL 同步](/ticdc/ticdc-bidirectional-replication.md#ddl-同步)。 | ||
- `ADMIN SHOW BDR ROLE` 可以显示该集群的 BDR role。 | ||
- `ADMIN UNSET BDR ROLE` 可以撤销之前设置的 BDR role。 | ||
|
||
> **警告:** | ||
> | ||
> 双向复制的 DDL 同步目前为实验特性,不建议在生产环境中使用。该功能可能会在未事先通知的情况下发生变化或删除。如果发现 bug,请在 GitHub 上提 [issue](https://github.com/pingcap/tidb/issues) 反馈。 | ||
|
||
## 语法图 | ||
|
||
```ebnf+diagram | ||
AdminShowBDRRoleStmt ::= | ||
'ADMIN' 'SHOW' 'BDR' 'ROLE' | ||
|
||
AdminSetBDRRoleStmt ::= | ||
'ADMIN' 'SET' 'BDR' 'ROLE' ('PRIMARY' | 'SECONDARY') | ||
|
||
AdminUnsetBDRRoleStmt ::= | ||
'ADMIN' 'UNSET' 'BDR' 'ROLE' | ||
``` | ||
|
||
## 示例 | ||
|
||
TiDB 集群默认没有 BDR role。 | ||
hfxsd marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
```sql | ||
ADMIN SHOW BDR ROLE; | ||
``` | ||
|
||
```sql | ||
+----------+ | ||
| BDR_ROLE | | ||
+----------+ | ||
| | | ||
+----------+ | ||
1 row in set (0.01 sec) | ||
``` | ||
|
||
执行以下命令可以将 BDR role 设置为 `PRIMARY`。 | ||
|
||
```sql | ||
ADMIN SET BDR ROLE PRIMARY; | ||
``` | ||
|
||
```sql | ||
Query OK, 0 rows affected (0.01 sec) | ||
``` | ||
|
||
```sql | ||
ADMIN SHOW BDR ROLE; | ||
+----------+ | ||
| BDR_ROLE | | ||
+----------+ | ||
| primary | | ||
Benjamin2037 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
+----------+ | ||
1 row in set (0.00 sec) | ||
``` | ||
|
||
撤销之前的设置。 | ||
|
||
```sql | ||
ADMIN UNSET BDR ROLE; | ||
``` | ||
|
||
```sql | ||
Query OK, 0 rows affected (0.01 sec) | ||
``` | ||
|
||
```sql | ||
ADMIN SHOW BDR ROLE; | ||
+----------+ | ||
| BDR_ROLE | | ||
+----------+ | ||
| | | ||
+----------+ | ||
1 row in set (0.01 sec) | ||
``` | ||
|
||
## MySQL 兼容性 | ||
|
||
`ADMIN [SET|SHOW|UNSET] BDR ROLE` 语句是 TiDB 对 MySQL 语法的扩展。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.