From 0257b2e12d21bc9dbcac53486b956ceb5d225bd2 Mon Sep 17 00:00:00 2001 From: Charlotte Liu <37295236+CharLotteiu@users.noreply.github.com> Date: Wed, 16 Dec 2020 14:01:21 +0800 Subject: [PATCH 1/3] cherry pick #4411 to release-4.0 Signed-off-by: ti-srebot --- system-variables.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/system-variables.md b/system-variables.md index 92667a28a53fc..4d51148a480ad 100644 --- a/system-variables.md +++ b/system-variables.md @@ -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. + +### `tidb_enable_amend_pessimistic_txn` New in v4.0.7 + +- 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) ### tidb_enable_cascades_planner - Scope: SESSION | GLOBAL From 812c3172cf5aadecc8873774e9e814a14f60cc53 Mon Sep 17 00:00:00 2001 From: TomShawn <41534398+TomShawn@users.noreply.github.com> Date: Wed, 16 Dec 2020 14:05:39 +0800 Subject: [PATCH 2/3] Apply suggestions from code review --- system-variables.md | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/system-variables.md b/system-variables.md index 4d51148a480ad..7a997e9dec9ca 100644 --- a/system-variables.md +++ b/system-variables.md @@ -254,23 +254,6 @@ 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. - ### `tidb_enable_amend_pessimistic_txn` New in v4.0.7 - Scope: SESSION | GLOBAL @@ -284,8 +267,6 @@ Constraint checking is always performed in place for pessimistic transactions (d > **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) ### tidb_enable_cascades_planner - Scope: SESSION | GLOBAL From a0160297817b6711c4dee93f05457e6405727550 Mon Sep 17 00:00:00 2001 From: TomShawn <41534398+TomShawn@users.noreply.github.com> Date: Wed, 16 Dec 2020 14:06:14 +0800 Subject: [PATCH 3/3] Update system-variables.md --- system-variables.md | 1 + 1 file changed, 1 insertion(+) diff --git a/system-variables.md b/system-variables.md index 7a997e9dec9ca..26e6990c84ae8 100644 --- a/system-variables.md +++ b/system-variables.md @@ -267,6 +267,7 @@ Constraint checking is always performed in place for pessimistic transactions (d > **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). + ### tidb_enable_cascades_planner - Scope: SESSION | GLOBAL