From 5878fcfd73a59ed42622f3138664f8c5e84dc924 Mon Sep 17 00:00:00 2001 From: houfaxin Date: Tue, 8 Apr 2025 14:18:44 +0800 Subject: [PATCH 1/8] Update system-variables.md --- system-variables.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/system-variables.md b/system-variables.md index d736b0cac6381..b25a97cd53fc3 100644 --- a/system-variables.md +++ b/system-variables.md @@ -3888,6 +3888,21 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified - Range: `[100, 16384]` - This variable is used to set the maximum number of schema versions (the table IDs modified for corresponding versions) allowed to be cached. The value range is 100 ~ 16384. +### tidb_max_dist_task_nodes New in v9.0.0 + +- Scope:SESSION | GLOBAL +- Persists to cluster: Yes +- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): No +- Type: Integer +- Default value: `-1` +- Range: `-1` or `[1, 128]` +- This variable defines the maximum number of TiDB nodes that can be used by the Distributed eXecution Framework (DXF). The default value is `-1`, which indicates automatic mode. In automatic mode, the system dynamically calculates the value as `min(3, tikv_nodes / 3)`, where `tikv_nodes` represents the number of TiKV nodes in the cluster. + +> **Note:** +> +> If you explicitly set the [`tidb_service_scope`](/system-variables.md#tidb_service_scope) system variable for some TiDB nodes, the distributed execution framework will only schedule tasks to these nodes. In this case, even if `tidb_max_dist_task_nodes` is set to a larger value, the actual number of TiDB nodes used will not exceed the number of nodes explicitly set by `tidb_service_scope`. +> For example, in a cluster with 10 TiDB nodes, if 4 nodes have the same `tidb_service_scope` value set to `group1`, and you also set `tidb_max_dist_task_nodes = 5`, the actual number of TiDB nodes participating in task execution will be `4`, instead of `5`. + ### tidb_max_paging_size New in v6.3.0 - Scope: SESSION | GLOBAL From 5c6add5d8cc72c901866d1e6ab25cf16e67c7514 Mon Sep 17 00:00:00 2001 From: houfaxin Date: Tue, 8 Apr 2025 14:23:54 +0800 Subject: [PATCH 2/8] 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 b25a97cd53fc3..0bc050beef18c 100644 --- a/system-variables.md +++ b/system-variables.md @@ -3900,7 +3900,7 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified > **Note:** > -> If you explicitly set the [`tidb_service_scope`](/system-variables.md#tidb_service_scope) system variable for some TiDB nodes, the distributed execution framework will only schedule tasks to these nodes. In this case, even if `tidb_max_dist_task_nodes` is set to a larger value, the actual number of TiDB nodes used will not exceed the number of nodes explicitly set by `tidb_service_scope`. +> If you explicitly set the [`tidb_service_scope`](#tidb_service_scope-new-in-v740) system variable for some TiDB nodes, the distributed execution framework will only schedule tasks to these nodes. In this case, even if `tidb_max_dist_task_nodes` is set to a larger value, the actual number of TiDB nodes used will not exceed the number of nodes explicitly set by `tidb_service_scope`. > For example, in a cluster with 10 TiDB nodes, if 4 nodes have the same `tidb_service_scope` value set to `group1`, and you also set `tidb_max_dist_task_nodes = 5`, the actual number of TiDB nodes participating in task execution will be `4`, instead of `5`. ### tidb_max_paging_size New in v6.3.0 From cbbfeee31246b88a149b0d5b07e829b32ac21de1 Mon Sep 17 00:00:00 2001 From: houfaxin Date: Tue, 8 Apr 2025 14:33:58 +0800 Subject: [PATCH 3/8] Update system-variables.md --- system-variables.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system-variables.md b/system-variables.md index 0bc050beef18c..6eae5441cb80f 100644 --- a/system-variables.md +++ b/system-variables.md @@ -3896,11 +3896,11 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified - Type: Integer - Default value: `-1` - Range: `-1` or `[1, 128]` -- This variable defines the maximum number of TiDB nodes that can be used by the Distributed eXecution Framework (DXF). The default value is `-1`, which indicates automatic mode. In automatic mode, the system dynamically calculates the value as `min(3, tikv_nodes / 3)`, where `tikv_nodes` represents the number of TiKV nodes in the cluster. +- This variable defines the maximum number of TiDB nodes that can be used by the Distributed eXecution Framework (DXF). The default value is `-1`, which indicates automatic mode. In automatic mode, TiDB dynamically calculates the value as `min(3, tikv_nodes / 3)`, where `tikv_nodes` represents the number of TiKV nodes in the cluster. > **Note:** > -> If you explicitly set the [`tidb_service_scope`](#tidb_service_scope-new-in-v740) system variable for some TiDB nodes, the distributed execution framework will only schedule tasks to these nodes. In this case, even if `tidb_max_dist_task_nodes` is set to a larger value, the actual number of TiDB nodes used will not exceed the number of nodes explicitly set by `tidb_service_scope`. +> If you explicitly set the [`tidb_service_scope`](#tidb_service_scope-new-in-v740) system variable for some TiDB nodes, the Distributed eXecution Framework will only schedule tasks to these nodes. In this case, even if `tidb_max_dist_task_nodes` is set to a larger value, the actual number of TiDB nodes used will not exceed the number of nodes explicitly set by `tidb_service_scope`. > For example, in a cluster with 10 TiDB nodes, if 4 nodes have the same `tidb_service_scope` value set to `group1`, and you also set `tidb_max_dist_task_nodes = 5`, the actual number of TiDB nodes participating in task execution will be `4`, instead of `5`. ### tidb_max_paging_size New in v6.3.0 From 365572e18ae0526381fb360d74bc098177e8543c Mon Sep 17 00:00:00 2001 From: xixirangrang Date: Tue, 8 Apr 2025 15:10:18 +0800 Subject: [PATCH 4/8] Update system-variables.md Co-authored-by: Frank945946 <108602632+Frank945946@users.noreply.github.com> --- system-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index 6eae5441cb80f..5bc15242ec7b6 100644 --- a/system-variables.md +++ b/system-variables.md @@ -3901,7 +3901,7 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified > **Note:** > > If you explicitly set the [`tidb_service_scope`](#tidb_service_scope-new-in-v740) system variable for some TiDB nodes, the Distributed eXecution Framework will only schedule tasks to these nodes. In this case, even if `tidb_max_dist_task_nodes` is set to a larger value, the actual number of TiDB nodes used will not exceed the number of nodes explicitly set by `tidb_service_scope`. -> For example, in a cluster with 10 TiDB nodes, if 4 nodes have the same `tidb_service_scope` value set to `group1`, and you also set `tidb_max_dist_task_nodes = 5`, the actual number of TiDB nodes participating in task execution will be `4`, instead of `5`. +> For example, in a cluster with 10 TiDB nodes, if 4 nodes have the same `tidb_service_scope` value set to `group1`, and you also set `tidb_max_dist_task_nodes = 5`, the actual number of TiDB nodes participating in distributed task execution will be `4`, instead of `5`. ### tidb_max_paging_size New in v6.3.0 From 8c05c64eaac83a95b85bc392be62fe3c6358a0b0 Mon Sep 17 00:00:00 2001 From: xixirangrang Date: Tue, 8 Apr 2025 15:47:34 +0800 Subject: [PATCH 5/8] 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 5bc15242ec7b6..e1f200a46665e 100644 --- a/system-variables.md +++ b/system-variables.md @@ -3896,7 +3896,7 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified - Type: Integer - Default value: `-1` - Range: `-1` or `[1, 128]` -- This variable defines the maximum number of TiDB nodes that can be used by the Distributed eXecution Framework (DXF). The default value is `-1`, which indicates automatic mode. In automatic mode, TiDB dynamically calculates the value as `min(3, tikv_nodes / 3)`, where `tikv_nodes` represents the number of TiKV nodes in the cluster. +- This variable defines the maximum number of TiDB nodes that can be used by the Distributed eXecution Framework (DXF). The default value is `-1`, which indicates that automatic mode is enabled. In automatic mode, TiDB dynamically calculates the value as `min(3, tikv_nodes / 3)`, where `tikv_nodes` represents the number of TiKV nodes in the cluster. > **Note:** > From e7cade50c8be867c364811282f4ef6a252522f84 Mon Sep 17 00:00:00 2001 From: Lilian Lee Date: Tue, 8 Apr 2025 15:52:44 +0800 Subject: [PATCH 6/8] Apply suggestions from code review --- system-variables.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index e1f200a46665e..bf727f15b7eff 100644 --- a/system-variables.md +++ b/system-variables.md @@ -3890,7 +3890,7 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified ### tidb_max_dist_task_nodes New in v9.0.0 -- Scope:SESSION | GLOBAL +- Scope: SESSION | GLOBAL - Persists to cluster: Yes - Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): No - Type: Integer From 6bf4d1534a167c525bdb696351475f2902c0a4ee Mon Sep 17 00:00:00 2001 From: Lilian Lee Date: Tue, 8 Apr 2025 16:33:16 +0800 Subject: [PATCH 7/8] Apply suggestions from code review --- system-variables.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/system-variables.md b/system-variables.md index bf727f15b7eff..b42a138e177f9 100644 --- a/system-variables.md +++ b/system-variables.md @@ -3896,12 +3896,13 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified - Type: Integer - Default value: `-1` - Range: `-1` or `[1, 128]` -- This variable defines the maximum number of TiDB nodes that can be used by the Distributed eXecution Framework (DXF). The default value is `-1`, which indicates that automatic mode is enabled. In automatic mode, TiDB dynamically calculates the value as `min(3, tikv_nodes / 3)`, where `tikv_nodes` represents the number of TiKV nodes in the cluster. +- This variable defines the maximum number of TiDB nodes that the Distributed eXecution Framework (DXF) tasks can use. The default value is `-1`, which indicates that automatic mode is enabled. In automatic mode, TiDB dynamically calculates the value as `min(3, tikv_nodes / 3)`, where `tikv_nodes` represents the number of TiKV nodes in the cluster. > **Note:** > -> If you explicitly set the [`tidb_service_scope`](#tidb_service_scope-new-in-v740) system variable for some TiDB nodes, the Distributed eXecution Framework will only schedule tasks to these nodes. In this case, even if `tidb_max_dist_task_nodes` is set to a larger value, the actual number of TiDB nodes used will not exceed the number of nodes explicitly set by `tidb_service_scope`. -> For example, in a cluster with 10 TiDB nodes, if 4 nodes have the same `tidb_service_scope` value set to `group1`, and you also set `tidb_max_dist_task_nodes = 5`, the actual number of TiDB nodes participating in distributed task execution will be `4`, instead of `5`. +> If you explicitly set the [`tidb_service_scope`](#tidb_service_scope-new-in-v740) system variable for some TiDB nodes, the Distributed eXecution Framework schedules tasks only to these nodes. In this case, even if you set `tidb_max_dist_task_nodes` to a larger value, the framework uses no more than the number of nodes explicitly configured with `tidb_service_scope`. +> +> For example, if the cluster has 10 TiDB nodes, and 4 of them are configured with `tidb_service_scope = group1`, then even if you set `tidb_max_dist_task_nodes = 5`, only 4 nodes participate in task execution. ### tidb_max_paging_size New in v6.3.0 From 4e2fb3346b4c77376b499d0609ee626df7120bbc Mon Sep 17 00:00:00 2001 From: xixirangrang Date: Thu, 26 Feb 2026 12:29:42 +0800 Subject: [PATCH 8/8] 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 b42a138e177f9..5671ffa693d3e 100644 --- a/system-variables.md +++ b/system-variables.md @@ -3888,7 +3888,7 @@ For a system upgraded to v5.0 from an earlier version, if you have not modified - Range: `[100, 16384]` - This variable is used to set the maximum number of schema versions (the table IDs modified for corresponding versions) allowed to be cached. The value range is 100 ~ 16384. -### tidb_max_dist_task_nodes New in v9.0.0 +### tidb_max_dist_task_nodes New in v8.5.6 and v9.0.0 - Scope: SESSION | GLOBAL - Persists to cluster: Yes