From ee77cde1405f98d05ac3416d0b819cd445b5848c Mon Sep 17 00:00:00 2001 From: Ryan Leung Date: Thu, 23 Jan 2025 11:04:41 +0800 Subject: [PATCH 1/2] 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 3fc49dadc3bfa..98a3b12d424b2 100644 --- a/system-variables.md +++ b/system-variables.md @@ -6052,6 +6052,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 1682aeac2c6e5406234c165eabbdcb47bbdb06a4 Mon Sep 17 00:00:00 2001 From: Ryan Leung Date: Tue, 10 Jun 2025 13:35:01 +0800 Subject: [PATCH 2/2] 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 98a3b12d424b2..0d5d5d2305c2d 100644 --- a/system-variables.md +++ b/system-variables.md @@ -6059,8 +6059,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