From 3994624ad006a2930639e1758c4521760b20ecdc Mon Sep 17 00:00:00 2001 From: Ryan Leung Date: Thu, 23 Jan 2025 11:04:41 +0800 Subject: [PATCH 1/6] add circuit breaker variable Signed-off-by: Ryan Leung --- system-variables.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/system-variables.md b/system-variables.md index ff19d4fc4416a..076eaded89dcd 100644 --- a/system-variables.md +++ b/system-variables.md @@ -6304,6 +6304,16 @@ For details, see [Identify Slow Queries](/identify-slow-queries.md). > - `PARALLEL` and `PARALLEL-FAST` modes are incompatible with [`tidb_tso_client_batch_max_wait_time`](#tidb_tso_client_batch_max_wait_time-new-in-v530) and [`tidb_enable_tso_follower_proxy`](#tidb_enable_tso_follower_proxy-new-in-v530). If either [`tidb_tso_client_batch_max_wait_time`](#tidb_tso_client_batch_max_wait_time-new-in-v530) is set to a non-zero value or [`tidb_enable_tso_follower_proxy`](#tidb_enable_tso_follower_proxy-new-in-v530) is enabled, configuring `tidb_tso_client_rpc_mode` does not take effect, and TiDB always works in `DEFAULT` mode. > - `PARALLEL` and `PARALLEL-FAST` modes are designed to reduce the average time for retrieving TS in TiDB. In situations with significant latency fluctuations, such as long-tail latency or latency spikes, these two modes might not provide any remarkable performance improvements. + +### tidb_cb_pd_metadata_error_rate_threshold_pct + +- Scope: GLOBAL +- Persists to cluster: Yes +- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): No +- Default value: `0` +- Range: `[0, 100]` +- This variable controls whether TiDB triggers the circuit breaker according to the error rate percentage of the specific requests sending to PD. + ### tidb_ttl_delete_rate_limit New in v6.5.0 > **Note:** From bfe9d181e33101a4e58a24645170fcd972622f63 Mon Sep 17 00:00:00 2001 From: Ryan Leung Date: Tue, 10 Jun 2025 13:35:01 +0800 Subject: [PATCH 2/6] address the comment Signed-off-by: Ryan Leung --- system-variables.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system-variables.md b/system-variables.md index 076eaded89dcd..f6b082948b5eb 100644 --- a/system-variables.md +++ b/system-variables.md @@ -6311,8 +6311,8 @@ For details, see [Identify Slow Queries](/identify-slow-queries.md). - Persists to cluster: Yes - Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): No - Default value: `0` -- Range: `[0, 100]` -- This variable controls whether TiDB triggers the circuit breaker according to the error rate percentage of the specific requests sending to PD. +- Range: `[0, 1]` +- This variable is used to control when TiDB triggers the circuit breaker. If set to 0 (the default) then the circuit breaker is disabled. If the variable is set to 0.01 to 1 then the circuit breaker is triggered if the error rate percentage, of the specific requests sent to PD, meets or exceeds the threshold. ### tidb_ttl_delete_rate_limit New in v6.5.0 From 50c74959d909bcd567ca51cb2ecc30bdd42f8fe4 Mon Sep 17 00:00:00 2001 From: Ryan Leung Date: Tue, 24 Jun 2025 17:24:57 +0800 Subject: [PATCH 3/6] address the comment Signed-off-by: Ryan Leung --- system-variables.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system-variables.md b/system-variables.md index f6b082948b5eb..335dddeb01f4e 100644 --- a/system-variables.md +++ b/system-variables.md @@ -6305,14 +6305,14 @@ For details, see [Identify Slow Queries](/identify-slow-queries.md). > - `PARALLEL` and `PARALLEL-FAST` modes are designed to reduce the average time for retrieving TS in TiDB. In situations with significant latency fluctuations, such as long-tail latency or latency spikes, these two modes might not provide any remarkable performance improvements. -### tidb_cb_pd_metadata_error_rate_threshold_pct +### tidb_cb_pd_metadata_error_rate_threshold_ratio - Scope: GLOBAL - Persists to cluster: Yes - Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): No - Default value: `0` - Range: `[0, 1]` -- This variable is used to control when TiDB triggers the circuit breaker. If set to 0 (the default) then the circuit breaker is disabled. If the variable is set to 0.01 to 1 then the circuit breaker is triggered if the error rate percentage, of the specific requests sent to PD, meets or exceeds the threshold. +- This variable is used to control when TiDB triggers the circuit breaker. If set to 0 (the default) then the circuit breaker is disabled. If the variable is set to 0.01 to 1 then the circuit breaker is triggered if the error rate ratio, of the specific requests sent to PD, meets or exceeds the threshold. ### tidb_ttl_delete_rate_limit New in v6.5.0 From a1d148cea4c73e045d29a187d4663b85fe8981c2 Mon Sep 17 00:00:00 2001 From: xixirangrang Date: Mon, 30 Jun 2025 11:50:46 +0800 Subject: [PATCH 4/6] Apply suggestions from code review --- system-variables.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/system-variables.md b/system-variables.md index 335dddeb01f4e..3382182df7463 100644 --- a/system-variables.md +++ b/system-variables.md @@ -6304,15 +6304,14 @@ For details, see [Identify Slow Queries](/identify-slow-queries.md). > - `PARALLEL` and `PARALLEL-FAST` modes are incompatible with [`tidb_tso_client_batch_max_wait_time`](#tidb_tso_client_batch_max_wait_time-new-in-v530) and [`tidb_enable_tso_follower_proxy`](#tidb_enable_tso_follower_proxy-new-in-v530). If either [`tidb_tso_client_batch_max_wait_time`](#tidb_tso_client_batch_max_wait_time-new-in-v530) is set to a non-zero value or [`tidb_enable_tso_follower_proxy`](#tidb_enable_tso_follower_proxy-new-in-v530) is enabled, configuring `tidb_tso_client_rpc_mode` does not take effect, and TiDB always works in `DEFAULT` mode. > - `PARALLEL` and `PARALLEL-FAST` modes are designed to reduce the average time for retrieving TS in TiDB. In situations with significant latency fluctuations, such as long-tail latency or latency spikes, these two modes might not provide any remarkable performance improvements. - -### tidb_cb_pd_metadata_error_rate_threshold_ratio +### tidb_cb_pd_metadata_error_rate_threshold_ratio New in v9.0.0 - Scope: GLOBAL - Persists to cluster: Yes - Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): No - Default value: `0` - Range: `[0, 1]` -- This variable is used to control when TiDB triggers the circuit breaker. If set to 0 (the default) then the circuit breaker is disabled. If the variable is set to 0.01 to 1 then the circuit breaker is triggered if the error rate ratio, of the specific requests sent to PD, meets or exceeds the threshold. +- This variable controls when TiDB triggers the circuit breaker. A value of `0` (default) disables the circuit breaker. A value between `0.01` and `1` enables it, causing the circuit breaker to trigger when the error rate of specific requests to PD meets or exceeds the threshold. ### tidb_ttl_delete_rate_limit New in v6.5.0 From d582f654a3675215445378cd92ad201334dd1321 Mon Sep 17 00:00:00 2001 From: xixirangrang Date: Thu, 9 Oct 2025 19:38:19 +0800 Subject: [PATCH 5/6] Apply suggestion from @lilin90 Co-authored-by: Lilian Lee --- system-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index 3382182df7463..b8c97e9735045 100644 --- a/system-variables.md +++ b/system-variables.md @@ -6311,7 +6311,7 @@ For details, see [Identify Slow Queries](/identify-slow-queries.md). - Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): No - Default value: `0` - Range: `[0, 1]` -- This variable controls when TiDB triggers the circuit breaker. A value of `0` (default) disables the circuit breaker. A value between `0.01` and `1` enables it, causing the circuit breaker to trigger when the error rate of specific requests to PD meets or exceeds the threshold. +- This variable controls when TiDB triggers the circuit breaker. Setting a value of `0` (default) disables the circuit breaker. Setting a value between `0.01` and `1` enables it, causing the circuit breaker to trigger when the error rate of specific requests sent to PD reaches or exceeds the threshold. ### tidb_ttl_delete_rate_limit New in v6.5.0 From 30523c9f8c79279a0c0e28155b8686fdffd883da Mon Sep 17 00:00:00 2001 From: xixirangrang Date: Fri, 12 Dec 2025 10:54:37 +0800 Subject: [PATCH 6/6] Update system-variables.md --- system-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index b8c97e9735045..ace4f3345d2b2 100644 --- a/system-variables.md +++ b/system-variables.md @@ -6304,7 +6304,7 @@ For details, see [Identify Slow Queries](/identify-slow-queries.md). > - `PARALLEL` and `PARALLEL-FAST` modes are incompatible with [`tidb_tso_client_batch_max_wait_time`](#tidb_tso_client_batch_max_wait_time-new-in-v530) and [`tidb_enable_tso_follower_proxy`](#tidb_enable_tso_follower_proxy-new-in-v530). If either [`tidb_tso_client_batch_max_wait_time`](#tidb_tso_client_batch_max_wait_time-new-in-v530) is set to a non-zero value or [`tidb_enable_tso_follower_proxy`](#tidb_enable_tso_follower_proxy-new-in-v530) is enabled, configuring `tidb_tso_client_rpc_mode` does not take effect, and TiDB always works in `DEFAULT` mode. > - `PARALLEL` and `PARALLEL-FAST` modes are designed to reduce the average time for retrieving TS in TiDB. In situations with significant latency fluctuations, such as long-tail latency or latency spikes, these two modes might not provide any remarkable performance improvements. -### tidb_cb_pd_metadata_error_rate_threshold_ratio New in v9.0.0 +### tidb_cb_pd_metadata_error_rate_threshold_ratio New in v8.5.5 - Scope: GLOBAL - Persists to cluster: Yes