From eeafd91402e8db8eeac7d956113c20e1270a0379 Mon Sep 17 00:00:00 2001 From: houfaxin Date: Tue, 8 Apr 2025 14:18:44 +0800 Subject: [PATCH 1/7] Update system-variables.md --- system-variables.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/system-variables.md b/system-variables.md index 196217f715e14..5d5e6ad46a1a7 100644 --- a/system-variables.md +++ b/system-variables.md @@ -3778,6 +3778,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 eb854131c2c9891ea6d63539c5cd9c680d33b665 Mon Sep 17 00:00:00 2001 From: houfaxin Date: Tue, 8 Apr 2025 14:23:54 +0800 Subject: [PATCH 2/7] 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 5d5e6ad46a1a7..e1ba637189b7d 100644 --- a/system-variables.md +++ b/system-variables.md @@ -3790,7 +3790,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 1d0c0d254b47fa2a78bd45b2efb91077e6d9b295 Mon Sep 17 00:00:00 2001 From: houfaxin Date: Tue, 8 Apr 2025 14:33:58 +0800 Subject: [PATCH 3/7] 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 e1ba637189b7d..7b879009e934c 100644 --- a/system-variables.md +++ b/system-variables.md @@ -3786,11 +3786,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 9da6de2df3b4cdf8004fe1e7f7b0312a4ab21e3b Mon Sep 17 00:00:00 2001 From: xixirangrang Date: Tue, 8 Apr 2025 15:10:18 +0800 Subject: [PATCH 4/7] 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 7b879009e934c..2e6a07748bd56 100644 --- a/system-variables.md +++ b/system-variables.md @@ -3791,7 +3791,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 dbc2809ad752661f17eeb3c94757c121f12a21a7 Mon Sep 17 00:00:00 2001 From: xixirangrang Date: Tue, 8 Apr 2025 15:47:34 +0800 Subject: [PATCH 5/7] 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 2e6a07748bd56..59cb86d55ff7c 100644 --- a/system-variables.md +++ b/system-variables.md @@ -3786,7 +3786,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 51f3af7fc3e96ddfd6a39b9141282ae0cbc844bb Mon Sep 17 00:00:00 2001 From: Lilian Lee Date: Tue, 8 Apr 2025 15:52:44 +0800 Subject: [PATCH 6/7] 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 59cb86d55ff7c..e1bd0123c25ff 100644 --- a/system-variables.md +++ b/system-variables.md @@ -3780,7 +3780,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 4b727dc6ed2fa2e0549f810762b5947ebeb4214a Mon Sep 17 00:00:00 2001 From: Lilian Lee Date: Tue, 8 Apr 2025 16:33:16 +0800 Subject: [PATCH 7/7] 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 e1bd0123c25ff..6f99870efef50 100644 --- a/system-variables.md +++ b/system-variables.md @@ -3786,12 +3786,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