-
Notifications
You must be signed in to change notification settings - Fork 702
Update bdr mode && add description related bdr sql #15925
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 2 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
ca25896
initial draft
hfxsd c811569
Apply suggestions from code review
hfxsd 3baff3d
Update ticdc/ticdc-bidirectional-replication.md
hfxsd 9019925
Update sql-statement-admin-bdr-role.md
hfxsd 12b4758
Update ticdc-bidirectional-replication.md
hfxsd 1a0ab9c
Apply suggestions from code review
hfxsd ef8fa52
Update keywords.md
hfxsd 796beb7
Apply suggestions from code review
hfxsd f9e1ea8
Apply suggestions from code review
hfxsd bd390e4
Apply suggestions from code review
hfxsd 39f2061
Update ticdc/ticdc-bidirectional-replication.md
hfxsd 7c565a7
Update ticdc/ticdc-bidirectional-replication.md
hfxsd 9701a69
Apply suggestions from code review
hfxsd 9a84505
Update sql-statements/sql-statement-admin-bdr-role.md
hfxsd edc877a
Update ticdc/ticdc-bidirectional-replication.md
hfxsd fff06f6
Update ticdc/ticdc-bidirectional-replication.md
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
--- | ||
title: ADMIN [SET|SHOW] BDR ROLE | ||
summary: An overview of the usage of ADMIN [SET|SHOW] BDR ROLE for the TiDB database. | ||
--- | ||
|
||
# ADMIN [SET|SHOW] BDR ROLE | ||
|
||
- Use `ADMIN SET BDR ROLE` to set the BDR role of the cluster. Currently, you can set three BDR roles for a TiDB cluster: `PRIMARY`, `SECONDARY`, and `LOCAL_ONLY` (default). For more information about BDR roles, see [DDL Synchronization in TiCDC Bidirectional Replication](/ticdc/ticdc-bidirectional-replication.md#ddl-replication). | ||
- Use `ADMIN SHOW BDR ROLE` to show the BDR role of the cluster. | ||
|
||
> **Warning:** | ||
> | ||
> This feature is experimental. It is not recommended that you use it in the production environment. This feature might be changed or removed without prior notice. If you find a bug, you can report an [issue](https://github.com/pingcap/tidb/issues) on GitHub. | ||
|
||
## Synopsis | ||
|
||
```ebnf+diagram | ||
AdminShowBDRRoleStmt ::= | ||
'ADMIN' 'SHOW' 'BDR' 'ROLE' | ||
|
||
AdminSetBDRRoleStmt ::= | ||
'ADMIN' 'SET' 'BDR' 'ROLE' ('PRIMARY' | 'SECONDARY' | 'LOCAL_ONLY') | ||
``` | ||
|
||
## Examples | ||
|
||
The default BDR role of a TiDB cluster is `LOCAL_ONLY`. Run the folloiwng command to show the BDR role of the cluster. | ||
|
||
```sql | ||
ADMIN SHOW BDR ROLE; | ||
``` | ||
|
||
```sql | ||
+------------+ | ||
| BDR_ROLE | | ||
+------------+ | ||
| local_only | | ||
+------------+ | ||
1 row in set (0.01 sec) | ||
``` | ||
|
||
Run the following command to set the BDR role to `PRIMARY`. | ||
|
||
```sql | ||
ADMIN SET BDR ROLE PRIMARY; | ||
``` | ||
|
||
```sql | ||
Query OK, 0 rows affected (0.01 sec) | ||
``` | ||
|
||
```sql | ||
ADMIN SHOW BDR ROLE; | ||
+----------+ | ||
| BDR_ROLE | | ||
+----------+ | ||
| primary | | ||
+----------+ | ||
1 row in set (0.00 sec) | ||
``` | ||
|
||
## MySQL compatibility | ||
|
||
This statement is a TiDB extension to MySQL syntax. |
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.