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

system variable: add tidb_lock_unchanged_keys #14222

Merged
merged 3 commits into from
Jul 24, 2023
Merged
Changes from 1 commit
Commits
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
11 changes: 11 additions & 0 deletions system-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -2797,6 +2797,17 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified

</CustomContent>

### `tidb_lock_unchanged_keys` <span class="version-mark">New in v7.1.1</span>

- Scope: SESSION | GLOBAL
- Persists to cluster: Yes
- Type: Boolean
- Default value: `ON`
- This variable is used to control whether to lock specific keys in the following scenarios. When the value is set to `ON`, these keys are locked. When the value is set to `OFF`, no keys are locked.
Oreoxmt marked this conversation as resolved.
Show resolved Hide resolved
- Duplicate keys in `INSERT IGNORE` and `REPLACE` statements. Before v6.1.6, these keys were not locked. This issue has been fixed in [#42121](https://github.com/pingcap/tidb/issues/42121).
- Unique keys in `UPDATE` statements when the values of the keys are not changed. Before v6.5.2, these keys were not locked. This issue has been fixed in [#36438](https://github.com/pingcap/tidb/issues/36438).
- To maintain the consistency and rationality of the transaction, it is not recommended to change this value. If upgrading TiDB causes severe performance issues due to these two fixes, and the unlocked behavior is acceptable (see the preceding issues), you can set this variable to `OFF`.
Oreoxmt marked this conversation as resolved.
Show resolved Hide resolved

### tidb_log_file_max_days <span class="version-mark">New in v5.3.0</span>

- Scope: GLOBAL
Expand Down