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

add a new system variable tidb_enable_amend_pessimistic_txn (#4411) #4419

Merged
merged 3 commits into from
Dec 16, 2020
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
32 changes: 32 additions & 0 deletions system-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,38 @@ Constraint checking is always performed in place for pessimistic transactions (d

For more details, see [limits of retry](/optimistic-transaction.md#limits-of-retry).

<<<<<<< HEAD
=======
### tidb_distsql_scan_concurrency

- Scope: SESSION | GLOBAL
- Default value: 15
- This variable is used to set the concurrency of the `scan` operation.
- Use a bigger value in OLAP scenarios, and a smaller value in OLTP scenarios.
- For OLAP scenarios, the maximum value cannot exceed the number of CPU cores of all the TiKV nodes.

### tidb_dml_batch_size

- Scope: SESSION | GLOBAL
- Default value: 0
- When this value is greater than `0`, TiDB will batch commit statements such as `INSERT` or `LOAD DATA` into smaller transactions. This reduces memory usage and helps ensure that the `txn-total-size-limit` is not reached by bulk modifications.
- Only the value `0` provides ACID compliance. Setting this to any other value will break the atomicity and isolation guarantees of TiDB.

TomShawn marked this conversation as resolved.
Show resolved Hide resolved
### `tidb_enable_amend_pessimistic_txn` <span class="version-mark">New in v4.0.7</span>

- Scope: SESSION | GLOBAL
- Default value: 0
- This variable is used to control whether to enable the `AMEND TRANSACTION` feature. If you enable the `AMEND TRANSACTION` feature in a pessimistic transaction, when concurrent DDL operations and SCHEMA VERSION changes exist on tables associated with this transaction, TiDB attempts to amend the transaction. TiDB corrects the transaction commit to make the commit consistent with the latest valid SCHEMA VERSION so that the transaction can be successfully committed without getting the `Information schema is changed` error. This feature is effective on the following concurrent DDL operations:

- `ADD COLUMN` or `DROP COLUMN` operations.
- `MODIFY COLUMN` or `CHANGE COLUMN` operations which increase the length of a field.
- `ADD INDEX` or `DROP INDEX` operations in which the index column is created before the transaction is opened.

> **Note:**
>
> Currently, this feature is incompatible with TiDB Binlog in some scenarios and might cause semantic changes on a transaction. For more usage precautions of this feature, refer to [Incompatibility issues about transaction semantic](https://github.com/pingcap/tidb/issues/21069) and [Incompatibility issues about TiDB Binlog](https://github.com/pingcap/tidb/issues/20996).

>>>>>>> d8076e25... add a new system variable `tidb_enable_amend_pessimistic_txn` (#4411)
TomShawn marked this conversation as resolved.
Show resolved Hide resolved
### tidb_enable_cascades_planner
TomShawn marked this conversation as resolved.
Show resolved Hide resolved

- Scope: SESSION | GLOBAL
Expand Down