From 78794fe397858077ac1855d10a1360b6a3fa5c67 Mon Sep 17 00:00:00 2001 From: JaySon-Huang Date: Fri, 27 Jun 2025 11:52:38 +0800 Subject: [PATCH 01/10] Add new configs Signed-off-by: JaySon-Huang --- tiflash/tiflash-configuration.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tiflash/tiflash-configuration.md b/tiflash/tiflash-configuration.md index 247a70bad54a..d1d869c7cc98 100644 --- a/tiflash/tiflash-configuration.md +++ b/tiflash/tiflash-configuration.md @@ -117,6 +117,12 @@ summary: TiFlash 配置参数包括 PD 调度参数和 TiFlash 配置参数。PD - 单位:Byte。目前不支持如 `"10GB"` 的设置。 - `capacity` 列表的长度应当与 [`storage.main.dir`](#dir) 列表长度保持一致。 +#### storage.api_version 从 v9.0.0 版本开始引入 + +- 多租户的 TiDB 集群的场景下,支持 keyspace 相关的 API 与 TIKV、PD 之间进行通讯。 `0` 代表不使用 keyspace 相关 API,`2` 代表使用 keyspace 相关 API。 +- 默认值:`0` +- 可选值:`0`、`2` + #### storage.latest ##### `dir` @@ -434,6 +440,11 @@ I/O 限流功能相关配置。 - 表示 PageStorage 单个数据文件中有效数据的最低比例。当某个数据文件的有效数据比例低于该值时,会触发 GC 对该文件的数据进行整理。 - 默认值:`0.5` +##### `disagg_blocklist_wn_store_id` 从 v9.0.0 版本开始引入 + +- 使用 `,` 分割的 store_id 的字符串。表示在存算分离架构中,TiFlash 计算节点不会将请求分发至列表中 store_id 的 TiFlash 存储节点。 +- 默认值:`""`,表示 TiFlash 计算节点会将请求分发至所有 TiFlash 存储节点。 + ##### `max_bytes_before_external_group_by` 从 v7.0.0 版本开始引入 - 表示带 `GROUP BY` key 的 Hash Aggregation 算子在触发 spill 之前的最大可用内存,超过该阈值之后 Hash Aggregation 会采用[数据落盘](/tiflash/tiflash-spill-disk.md)的方式来减小内存使用。 From 1248462aeeae6459c2ee969fcd78314145bc093c Mon Sep 17 00:00:00 2001 From: JaySon Date: Fri, 27 Jun 2025 12:26:58 +0800 Subject: [PATCH 02/10] Apply suggestions from code review --- tiflash/tiflash-configuration.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tiflash/tiflash-configuration.md b/tiflash/tiflash-configuration.md index d1d869c7cc98..cceb4964b61a 100644 --- a/tiflash/tiflash-configuration.md +++ b/tiflash/tiflash-configuration.md @@ -119,7 +119,7 @@ summary: TiFlash 配置参数包括 PD 调度参数和 TiFlash 配置参数。PD #### storage.api_version 从 v9.0.0 版本开始引入 -- 多租户的 TiDB 集群的场景下,支持 keyspace 相关的 API 与 TIKV、PD 之间进行通讯。 `0` 代表不使用 keyspace 相关 API,`2` 代表使用 keyspace 相关 API。 +- 多租户的 TiDB 集群的场景下,支持使用 keyspace 相关的 API 与 TIKV、PD 之间进行通讯。 `0` 代表不使用 keyspace 相关 API,`2` 代表使用 keyspace 相关 API。 - 默认值:`0` - 可选值:`0`、`2` @@ -442,7 +442,7 @@ I/O 限流功能相关配置。 ##### `disagg_blocklist_wn_store_id` 从 v9.0.0 版本开始引入 -- 使用 `,` 分割的 store_id 的字符串。表示在存算分离架构中,TiFlash 计算节点不会将请求分发至列表中 store_id 的 TiFlash 存储节点。 +- 值为使用 `,` 分隔的 store_id 字符串,例如 "140,141"。表示在存算分离架构中,TiFlash 计算节点不会将请求分发至列表中 store_id 指定的 TiFlash 存储节点。 - 默认值:`""`,表示 TiFlash 计算节点会将请求分发至所有 TiFlash 存储节点。 ##### `max_bytes_before_external_group_by` 从 v7.0.0 版本开始引入 From 4d091ba6e879ba480f76fe4bbba966b89e34e19f Mon Sep 17 00:00:00 2001 From: JaySon-Huang Date: Mon, 30 Jun 2025 11:23:49 +0800 Subject: [PATCH 03/10] Add pd-ctl to select tiflash wn/cn Signed-off-by: JaySon-Huang --- pd-control.md | 28 ++++++++++++++++++++++++++-- tiflash/tiflash-configuration.md | 6 +++--- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/pd-control.md b/pd-control.md index ec0657deafd0..9714f18936bc 100644 --- a/pd-control.md +++ b/pd-control.md @@ -1565,8 +1565,32 @@ store --jq='.stores[].store | select(.labels | length>0 and contains([{"key":"en ``` ``` -{"id":1,"address":"127.0.0.1:20161""state_name":"Up"} -{"id":5,"address":"127.0.0.1:20162""state_name":"Up"} +{"id":1,"address":"127.0.0.1:20161","state_name":"Up"} +{"id":5,"address":"127.0.0.1:20162","state_name":"Up"} +... +``` + +### 查询存算分离架构下的 TiFlash 节点 + +查找[存算分离架构](/tiflash/tiflash-disaggregated-and-s3.md)下的 TiFlash Write Node + +```bash +store --jq='.stores[].store | select(.labels | length>0 and contains([{"key":"engine","value":"tiflash"}, {"key":"engine_role","value":"write"}])) | {id, address, labels, state_name}' +``` + +``` +{"id":130,"address":"10.2.12.81:9540","labels":[{"key":"engine_role","value":"write"},{"key":"engine","value":"tiflash"}],"state_name":"Up"} +... +``` + +查找[存算分离架构](/tiflash/tiflash-disaggregated-and-s3.md)下的 TiFlash Compute Node + +```bash +store --jq='.stores[].store | select(.labels | length>0 and contains([{"key":"engine","value":"tiflash_compute"}])) | {id, address, labels, state_name}' +``` + +``` +{"id":131,"address":"10.2.12.81:9550","labels":[{"key":"engine","value":"tiflash_compute"}],"state_name":"Up"} ... ``` diff --git a/tiflash/tiflash-configuration.md b/tiflash/tiflash-configuration.md index cceb4964b61a..145866c09a0e 100644 --- a/tiflash/tiflash-configuration.md +++ b/tiflash/tiflash-configuration.md @@ -119,7 +119,7 @@ summary: TiFlash 配置参数包括 PD 调度参数和 TiFlash 配置参数。PD #### storage.api_version 从 v9.0.0 版本开始引入 -- 多租户的 TiDB 集群的场景下,支持使用 keyspace 相关的 API 与 TIKV、PD 之间进行通讯。 `0` 代表不使用 keyspace 相关 API,`2` 代表使用 keyspace 相关 API。 +- 多租户的 TiDB 集群的场景下,支持 TiFlash 使用 keyspace 相关的 API 与 TiKV 和 PD 进行通讯。 `0` 代表不使用 keyspace 相关 API。`2` 代表使用 keyspace 相关 API,用于多租户场景。 - 默认值:`0` - 可选值:`0`、`2` @@ -442,8 +442,8 @@ I/O 限流功能相关配置。 ##### `disagg_blocklist_wn_store_id` 从 v9.0.0 版本开始引入 -- 值为使用 `,` 分隔的 store_id 字符串,例如 "140,141"。表示在存算分离架构中,TiFlash 计算节点不会将请求分发至列表中 store_id 指定的 TiFlash 存储节点。 -- 默认值:`""`,表示 TiFlash 计算节点会将请求分发至所有 TiFlash 存储节点。 +- 值为使用 `,` 分隔的 store_id 字符串,例如 "140,141"。表示在存算分离架构中,TiFlash Compute Node 不会将请求分发至列表中 store_id 指定的 TiFlash Write Node。可以使用 [pd-ctl](/pd-control.md#查询存算分离架构下的 TiFlash 节点) 查找集群中的 TiFlash Write Node 的 store_id。 +- 默认值:`""`,表示 TiFlash Compute Node 会将请求分发至所有 TiFlash Write Node。 ##### `max_bytes_before_external_group_by` 从 v7.0.0 版本开始引入 From 3df0063ac21118c95adad502b936a001bdb57559 Mon Sep 17 00:00:00 2001 From: JaySon Date: Mon, 30 Jun 2025 11:31:24 +0800 Subject: [PATCH 04/10] Apply suggestions from code review --- pd-control.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pd-control.md b/pd-control.md index 9714f18936bc..05255600429a 100644 --- a/pd-control.md +++ b/pd-control.md @@ -1579,7 +1579,7 @@ store --jq='.stores[].store | select(.labels | length>0 and contains([{"key":"en ``` ``` -{"id":130,"address":"10.2.12.81:9540","labels":[{"key":"engine_role","value":"write"},{"key":"engine","value":"tiflash"}],"state_name":"Up"} +{"id":130,"address":"172.31.8.1:10161","labels":[{"key":"engine_role","value":"write"},{"key":"engine","value":"tiflash"}],"state_name":"Up"} ... ``` @@ -1590,7 +1590,7 @@ store --jq='.stores[].store | select(.labels | length>0 and contains([{"key":"en ``` ``` -{"id":131,"address":"10.2.12.81:9550","labels":[{"key":"engine","value":"tiflash_compute"}],"state_name":"Up"} +{"id":131,"address":"172.31.9.1:10161","labels":[{"key":"engine","value":"tiflash_compute"}],"state_name":"Up"} ... ``` From 634c2672b0df51b2b19b10f6303f8e54890e47fd Mon Sep 17 00:00:00 2001 From: JaySon Date: Mon, 30 Jun 2025 11:32:04 +0800 Subject: [PATCH 05/10] Update tiflash/tiflash-configuration.md --- tiflash/tiflash-configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tiflash/tiflash-configuration.md b/tiflash/tiflash-configuration.md index 145866c09a0e..63b003281df5 100644 --- a/tiflash/tiflash-configuration.md +++ b/tiflash/tiflash-configuration.md @@ -442,7 +442,7 @@ I/O 限流功能相关配置。 ##### `disagg_blocklist_wn_store_id` 从 v9.0.0 版本开始引入 -- 值为使用 `,` 分隔的 store_id 字符串,例如 "140,141"。表示在存算分离架构中,TiFlash Compute Node 不会将请求分发至列表中 store_id 指定的 TiFlash Write Node。可以使用 [pd-ctl](/pd-control.md#查询存算分离架构下的 TiFlash 节点) 查找集群中的 TiFlash Write Node 的 store_id。 +- 值为使用 `,` 分隔的 store_id 字符串,例如 "140,141"。表示在存算分离架构中,TiFlash Compute Node 不会将请求分发至列表中 store_id 指定的 TiFlash Write Node。可以使用 [pd-ctl](/pd-control.md#查询存算分离架构下的 TiFlash 节点) 查找集群中 TiFlash Write Node 的 store_id。 - 默认值:`""`,表示 TiFlash Compute Node 会将请求分发至所有 TiFlash Write Node。 ##### `max_bytes_before_external_group_by` 从 v7.0.0 版本开始引入 From c3a1fc4172bdda210cddf2a7ef1ee895fecd7f3e Mon Sep 17 00:00:00 2001 From: JaySon-Huang Date: Mon, 30 Jun 2025 11:56:03 +0800 Subject: [PATCH 06/10] Update api_version Signed-off-by: JaySon-Huang --- tiflash/tiflash-configuration.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tiflash/tiflash-configuration.md b/tiflash/tiflash-configuration.md index 63b003281df5..793cf9e615d9 100644 --- a/tiflash/tiflash-configuration.md +++ b/tiflash/tiflash-configuration.md @@ -119,9 +119,11 @@ summary: TiFlash 配置参数包括 PD 调度参数和 TiFlash 配置参数。PD #### storage.api_version 从 v9.0.0 版本开始引入 -- 多租户的 TiDB 集群的场景下,支持 TiFlash 使用 keyspace 相关的 API 与 TiKV 和 PD 进行通讯。 `0` 代表不使用 keyspace 相关 API。`2` 代表使用 keyspace 相关 API,用于多租户场景。 -- 默认值:`0` -- 可选值:`0`、`2` +- TiFlash 与 PD、TiKV 进行通讯时的接口版本。 +- 可选值: + - `1`:使用 API V1 与 PD、TiKV 进行通讯。 + - `2`:使用 API V2 与 PD、TiKV 进行通讯,为多租户特性提供支持。 +- 默认值:`1` #### storage.latest From 8097d6653884dc380d47d01f99c2798391b4e253 Mon Sep 17 00:00:00 2001 From: JaySon Date: Mon, 30 Jun 2025 13:12:39 +0800 Subject: [PATCH 07/10] Update tiflash/tiflash-configuration.md Co-authored-by: Grace Cai --- tiflash/tiflash-configuration.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tiflash/tiflash-configuration.md b/tiflash/tiflash-configuration.md index 793cf9e615d9..aa6cd6631cd2 100644 --- a/tiflash/tiflash-configuration.md +++ b/tiflash/tiflash-configuration.md @@ -121,8 +121,8 @@ summary: TiFlash 配置参数包括 PD 调度参数和 TiFlash 配置参数。PD - TiFlash 与 PD、TiKV 进行通讯时的接口版本。 - 可选值: - - `1`:使用 API V1 与 PD、TiKV 进行通讯。 - - `2`:使用 API V2 与 PD、TiKV 进行通讯,为多租户特性提供支持。 + - `1`:TiFlash 使用 API V1 与 PD、TiKV 进行通信。 + - `2`:TiFlash 使用 API V2 与 PD、TiKV 进行通信,为多租户特性提供支持。 - 默认值:`1` #### storage.latest From 50564cebd67fdcad9d43fcc42060432e236ba798 Mon Sep 17 00:00:00 2001 From: JaySon Date: Mon, 30 Jun 2025 14:08:08 +0800 Subject: [PATCH 08/10] Apply suggestions from code review Co-authored-by: Grace Cai --- pd-control.md | 4 ++-- tiflash/tiflash-configuration.md | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pd-control.md b/pd-control.md index 05255600429a..17ae46137a33 100644 --- a/pd-control.md +++ b/pd-control.md @@ -1572,7 +1572,7 @@ store --jq='.stores[].store | select(.labels | length>0 and contains([{"key":"en ### 查询存算分离架构下的 TiFlash 节点 -查找[存算分离架构](/tiflash/tiflash-disaggregated-and-s3.md)下的 TiFlash Write Node +查找[存算分离架构](/tiflash/tiflash-disaggregated-and-s3.md)下的 TiFlash Write Node: ```bash store --jq='.stores[].store | select(.labels | length>0 and contains([{"key":"engine","value":"tiflash"}, {"key":"engine_role","value":"write"}])) | {id, address, labels, state_name}' @@ -1583,7 +1583,7 @@ store --jq='.stores[].store | select(.labels | length>0 and contains([{"key":"en ... ``` -查找[存算分离架构](/tiflash/tiflash-disaggregated-and-s3.md)下的 TiFlash Compute Node +查找[存算分离架构](/tiflash/tiflash-disaggregated-and-s3.md)下的 TiFlash Compute Node: ```bash store --jq='.stores[].store | select(.labels | length>0 and contains([{"key":"engine","value":"tiflash_compute"}])) | {id, address, labels, state_name}' diff --git a/tiflash/tiflash-configuration.md b/tiflash/tiflash-configuration.md index aa6cd6631cd2..fa199917ed54 100644 --- a/tiflash/tiflash-configuration.md +++ b/tiflash/tiflash-configuration.md @@ -444,7 +444,8 @@ I/O 限流功能相关配置。 ##### `disagg_blocklist_wn_store_id` 从 v9.0.0 版本开始引入 -- 值为使用 `,` 分隔的 store_id 字符串,例如 "140,141"。表示在存算分离架构中,TiFlash Compute Node 不会将请求分发至列表中 store_id 指定的 TiFlash Write Node。可以使用 [pd-ctl](/pd-control.md#查询存算分离架构下的 TiFlash 节点) 查找集群中 TiFlash Write Node 的 store_id。 +- 控制在存算分离架构下,TiFlash Compute Node 不会将请求分发至哪些 TiFlash Write Node。 +- 其值为使用 `,` 分隔的 store_id 字符串。例如,设置为 `"140,141"` 表示 TiFlash Compute Node 不会将请求分发至 store_id 为 `140` 或 `141` 的 TiFlash Write Node。可以使用 [pd-ctl](/pd-control.md#查询存算分离架构下的-tiflash-节点) 查找集群中 TiFlash Write Node 的 store_id。 - 默认值:`""`,表示 TiFlash Compute Node 会将请求分发至所有 TiFlash Write Node。 ##### `max_bytes_before_external_group_by` 从 v7.0.0 版本开始引入 From 4807c5f9f94b32f00ab00ede206d657c2f74054c Mon Sep 17 00:00:00 2001 From: Grace Cai Date: Mon, 30 Jun 2025 14:14:18 +0800 Subject: [PATCH 09/10] minor format updates --- tiflash/tiflash-configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tiflash/tiflash-configuration.md b/tiflash/tiflash-configuration.md index fa199917ed54..05dd46795a98 100644 --- a/tiflash/tiflash-configuration.md +++ b/tiflash/tiflash-configuration.md @@ -117,7 +117,7 @@ summary: TiFlash 配置参数包括 PD 调度参数和 TiFlash 配置参数。PD - 单位:Byte。目前不支持如 `"10GB"` 的设置。 - `capacity` 列表的长度应当与 [`storage.main.dir`](#dir) 列表长度保持一致。 -#### storage.api_version 从 v9.0.0 版本开始引入 +#### `storage.api_version` 从 v9.0.0 版本开始引入 - TiFlash 与 PD、TiKV 进行通讯时的接口版本。 - 可选值: From 17d2769a5f2fea2d55195ff2a36907ba7a19c81d Mon Sep 17 00:00:00 2001 From: Grace Cai Date: Mon, 30 Jun 2025 16:05:17 +0800 Subject: [PATCH 10/10] Update tiflash/tiflash-configuration.md Co-authored-by: JaySon --- tiflash/tiflash-configuration.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tiflash/tiflash-configuration.md b/tiflash/tiflash-configuration.md index 05dd46795a98..cdaa53408f6d 100644 --- a/tiflash/tiflash-configuration.md +++ b/tiflash/tiflash-configuration.md @@ -446,7 +446,8 @@ I/O 限流功能相关配置。 - 控制在存算分离架构下,TiFlash Compute Node 不会将请求分发至哪些 TiFlash Write Node。 - 其值为使用 `,` 分隔的 store_id 字符串。例如,设置为 `"140,141"` 表示 TiFlash Compute Node 不会将请求分发至 store_id 为 `140` 或 `141` 的 TiFlash Write Node。可以使用 [pd-ctl](/pd-control.md#查询存算分离架构下的-tiflash-节点) 查找集群中 TiFlash Write Node 的 store_id。 -- 默认值:`""`,表示 TiFlash Compute Node 会将请求分发至所有 TiFlash Write Node。 +- 如果其值为空字符串 `""`,表示 TiFlash Compute Node 会将请求分发至所有 TiFlash Write Node。 +- 默认值:`""` ##### `max_bytes_before_external_group_by` 从 v7.0.0 版本开始引入