Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: TomShawn <[email protected]>
  • Loading branch information
2 people authored and ti-chi-bot committed Apr 26, 2022
1 parent de831ae commit 601605b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion privilege-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ Dynamic privileges include:
* `ROLE_ADMIN`
* `CONNECTION_ADMIN`
* `SYSTEM_VARIABLES_ADMIN`
* `RESTRICTED_REPLICA_WRITER_ADMIN` allows privilege owners to perform write or update operations without being affected when the TiDB cluster is enabled the read-only mode. For details, see [`tidb_restricted_read_only`](/system-variables.md#tidb_restricted_read_only-new-in-v520).
* `RESTRICTED_REPLICA_WRITER_ADMIN` allows privilege owners to perform write or update operations without being affected when the read-only mode is enabled in the TiDB cluster. For details, see [`tidb_restricted_read_only`](/system-variables.md#tidb_restricted_read_only-new-in-v520).

To see the full set of dynamic privileges, execute the `SHOW PRIVILEGES` statement. Because plugins are permitted to add new privileges, the list of privileges that are assignable might differ based on your TiDB installation.

Expand Down
20 changes: 10 additions & 10 deletions system-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -748,16 +748,16 @@ Constraint checking is always performed in place for pessimistic transactions (d
- Scope: GLOBAL
- Default value: `0`
- Optional values: `0`, `1`
- This variable controls the read-only status of the entire cluster. If the variable is enabled (which means the value is `1`), all TiDB servers in the entire cluster turn on the read-only mode. In this case, TiDB only executes the statements that do not modify data, such as `SELECT`, `USE`, `SHOW`. For others, such as `INSERT` and `UPDATE`, TiDB rejects to execute those statements in the read-only mode.
- If you enabled the read-only mode by this variable, this only ensures that the entire cluster finally goes into the read-only status. Suppose that you have changed the value of this variable, but the changed status is not updated to other TiDB servers. In this situation, the un-updated TiDB is still **not** in the read-only mode.
- While enabling this variable, the executing SQL statements are not affected. TiDB only checks the read-only status for the SQL statements **to be** executed.
- While enabling this variable, the uncommitted transactions have the following results:
- For uncommitted read-only transactions, the transactions can be committed normally.
- For uncommitted transactions that are not read-only transactions, SQL statements executing write operations in these transactions are rejected.
- For uncommitted read-only transactions with modified data, commitments of these transactions are rejected.
- After the read-only mode is enabled, all users (including the users with the `SUPER` privilege) cannot execute the SQL statements that might write data unless the user is explicitly granted the `RESTRICTED_REPLICA_WRITER_ADMIN` privileges.
- The users with `RESTRICTED_VARIABLES_ADMIN` or `SUPER` privileges can modify this variable. However, if the [Security Enhanced Mode](#tidb_enable_enhanced_security) is enabled, only the users with the `RESTRICTED_VARIABLES_ADMIN` privilege can modify this variable.
- Value options: `0`, `1`
- This variable controls the read-only status of the entire cluster. If the variable is enabled (which means that the value is `1`), all TiDB servers in the entire cluster are in the read-only mode. In this case, TiDB only executes the statements that do not modify data, such as `SELECT`, `USE`, and `SHOW`. For other statements such as `INSERT` and `UPDATE`, TiDB rejects executing those statements in the read-only mode.
- Enabling the read-only mode using this variable only ensures that the entire cluster finally enters the read-only status. If you have changed the value of this variable in a TiDB cluster but the change has not yet propagated to other TiDB servers, the un-updated TiDB servers are still **not** in the read-only mode.
- When this variable is enabled, the SQL statements being executed are not affected. TiDB only performs the read-only check for the SQL statements **to be** executed.
- When this variable is enabled, TiDB handles the uncommitted transactions in the following ways:
- For uncommitted read-only transactions, you can commit the transactions normally.
- For uncommitted transactions that are not read-only, SQL statements that perform write operations in these transactions are rejected.
- For uncommitted read-only transactions with modified data, the commit of these transactions is rejected.
- After the read-only mode is enabled, all users (including the users with the `SUPER` privilege) cannot execute the SQL statements that might write data unless the user is explicitly granted the `RESTRICTED_REPLICA_WRITER_ADMIN` privilege.
- Users with `RESTRICTED_VARIABLES_ADMIN` or `SUPER` privileges can modify this variable. However, if the [security enhanced mode](#tidb_enable_enhanced_security) is enabled, only the users with the `RESTRICTED_VARIABLES_ADMIN` privilege can modify this variable.
### tidb_enable_fast_analyze
Expand Down

0 comments on commit 601605b

Please sign in to comment.