From 7d953bff8c1bc71db3fc09a86a8ad0febb358e4c Mon Sep 17 00:00:00 2001 From: TomShawn <41534398+TomShawn@users.noreply.github.com> Date: Mon, 29 Jun 2020 16:38:51 +0800 Subject: [PATCH] cherry pick #3003 to release-4.0 Signed-off-by: ti-srebot --- command-line-flags-for-tidb-configuration.md | 35 +++++++++++++++++ tidb-configuration-file.md | 41 ++++++++++---------- tidb-specific-system-variables.md | 6 +++ 3 files changed, 62 insertions(+), 20 deletions(-) diff --git a/command-line-flags-for-tidb-configuration.md b/command-line-flags-for-tidb-configuration.md index b9d7d485844f4..67466bcb96ad9 100644 --- a/command-line-flags-for-tidb-configuration.md +++ b/command-line-flags-for-tidb-configuration.md @@ -39,6 +39,11 @@ When you start the TiDB cluster, you can use command-line options or environment - The TiDB server monitors this address. - The "0.0.0.0" address monitors all network cards by default. If you have multiple network cards, specify the network card that provides service, such as `192.168.100.113`. +## `--enable-binlog` + ++ Enables or disables TiDB binlog generation ++ Default: false + ## `-L` - The log level @@ -151,3 +156,33 @@ When you start the TiDB cluster, you can use command-line options or environment - Outputs the version of TiDB - Default: "" + +## `--plugin-dir` + ++ The storage directory for plugins. ++ Default: "/data/deploy/plugin" + +## `--plugin-load` + ++ The names of the plugins to be loaded, each separated by a comma. ++ Default: "" + +## `--affinity-cpus` + ++ Sets the CPU affinity of TiDB servers, which is separated by commas. For example, "1,2,3". ++ Default: "" + +## `--repair-mode` + ++ Determines whether to enable the repair mode, which is only used in the data repair scenario. ++ Default: false + +## `--repair-list` + ++ The names of the tables to be repaired in the repair mode. ++ Default: "" + +## `--require-secure-transport` + ++ Determines whether to require the client to use the secure mode for data transport. ++ Default: false diff --git a/tidb-configuration-file.md b/tidb-configuration-file.md index 8cb49691ce8b4..16043f526bdda 100644 --- a/tidb-configuration-file.md +++ b/tidb-configuration-file.md @@ -18,10 +18,15 @@ The TiDB configuration file supports more options than command-line parameters. - Default value: `true` - It is recommended to set it to `false` if you need to create a large number of tables. +### `token-limit` + ++ The number of sessions that can execute requests concurrently. ++ Default value: `1000` + ### `mem-quota-query` - The maximum memory available for a single SQL statement. -- Default value: `1073741824` +- Default value: `1073741824` (in bytes) - Requests that require more memory than this value are handled based on the behavior defined by `oom-action`. - This value is the initial value of the system variable [`tidb_mem_quota_query`](/tidb-specific-system-variables.md#tidb_mem_quota_query). @@ -178,6 +183,12 @@ Configuration items related to log. - Default value: `300ms` - If the value in a query is larger than the default value, it is a slow query and is output to the slow log. +### `record-plan-in-slow-log` + ++ Determines whether to record execution plans in the slow log. ++ Default value: `1` ++ `0` means to disable, and `1` (by default) means to enable. The value of this parameter is the initial value of the [`tidb_record_plan_in_slow_log`](/tidb-specific-system-variables.md#tidb_record_plan_in_slow_log) system variable. + ### `expensive-threshold` - Outputs the threshold value of the number of rows for the `expensive` operation. @@ -218,12 +229,6 @@ Configuration items related to log files. - Default value: `0` - All the log files are retained by default. If you set it to `7`, seven log files are retained at maximum. -#### `log-rotate` - -- Determines whether to create a new log file every day. -- Default value: `true` -- If you set the parameter to `true`, a new log file is created every day. If you set it to `false`, the log is output to a single log file. - ## Security Configuration items related to security. @@ -263,11 +268,6 @@ Configuration items related to security. - The path of the SSL private key file used to connect TiKV or PD with TLS. - Default value: "" -### `skip-grant-table` - -- Determines whether to skip permission check. -- Default value: `false` - ## Performance Configuration items related to performance. @@ -292,9 +292,9 @@ Configuration items related to performance. ### `txn-total-size-limit` -- The size limit of a transaction. -- Default value: `104857600` -- The total size of all key-value entries in bytes should be less than this value. Note that if the `binlog` is enabled, this value should be less than `104857600` (which means 100MB), because of the limitation of the binlog component. If `binlog` is not enabled, the maximum value of this configuration is `10737418240` (which means 10GB). +- The size limit of a single transaction in TiDB. +- Default value: `104857600` (in bytes) +- In a single transaction, the total size of key-value records cannot exceed this value. The maximum value of this parameter is `10737418240` (10 GB). Note that if you have used the binlog to serve the downstream consumer Kafka (such as the `arbiter` cluster), the value of this parameter must be no more than `1073741824` (1 GB). This is because 1 GB is the upper limit of a single message size that Kafka can process. Otherwise, an error is returned if this limit is exceeded. ### `tcp-keep-alive` @@ -398,11 +398,12 @@ The Plan Cache configuration of the `PREPARE` statement. - Default value: `41s` - It is required to set this value larger than twice of the Raft election timeout. -### `max-txn-time-use` +### `max-txn-ttl` -- The maximum execution time allowed for a single transaction. -- Default value: `590` -- unit: second +- The longest time that a single transaction can hold locks. If this time is exceeded, the locks of a transaction might be cleared by other transactions so that this transaction cannot be successfully committed. +- Default value: `600000` +- Unit: Millisecond +- The transaction that holds locks longer than this time can only be committed or rolled back. The commit might not be successful. ### `max-batch-size` @@ -535,7 +536,7 @@ Configurations related to the `events_statement_summary_by_digest` table. ### max-retry-count -- The max number of retries of each statement in pessimistic transactions. Exceeding this limit results in error. +- The maximum number of retries of each statement in pessimistic transactions. If the number of retries exceeds this limit, an error occurs. - Default value: `256` ## experimental diff --git a/tidb-specific-system-variables.md b/tidb-specific-system-variables.md index 7838ca7a7d1ec..d5697c96c211d 100644 --- a/tidb-specific-system-variables.md +++ b/tidb-specific-system-variables.md @@ -396,6 +396,12 @@ Usage of statements: - If you upgrade from a TiDB version earlier than 4.0.0 to 4.0.0, the format version is not changed, and TiDB continues to use the old format of version `1` to write data to the table, which means that **only newly created clusters use the new data format by default**. - Note that modifying this variable does not affect the old data that has been saved, but applies the corresponding version format only to the newly written data after modifying this variable. +### tidb_record_plan_in_slow_log + +- Scope: SESSION +- Default value: `1` +- Controls whether to include the execution plan of slow queries in the slow log. + ## tidb_slow_log_threshold - Scope: SESSION