Support binding a TiFlash node to a specific keyspace

未关闭
#11,279 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@ChangRui-Ryan 已经在做这个了。

开始于 2026年11月9日。

  • #11280 来自 @ChangRui-Ryan —— 未关闭

评估

难度
4/5
预计耗时
3-5 天
新手友好度
42/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
cpp
领域
backend

调研方向

Start by locating TiFlash startup configuration and the code that builds the proxy's --labels argument; the issue names no files or tests. Trace how store labels are reported to PD and how startup configuration is validated. Done means flash.keyspace_name is validated and, when set, reported as the keyspace label; the required client-go filter is a companion change.

由索引模型根据 Issue 内容生成。

描述

type/enhancement

Enhancement

Background

With keyspace-based multi-tenancy, a single cluster hosts multiple keyspaces. TiDB instances are bound to their keyspaces, but TiFlash nodes are not: PD's GetTiFlashComputeStores returns all tiflash compute stores in the cluster regardless of keyspace, and there is no way to dedicate a TiFlash (CN) node to one keyspace.

As a result, in multi-keyspace deployments every keyspace shares every TiFlash node. One keyspace's workload can consume all TiFlash compute capacity and starve the others, and per-keyspace capacity planning is impossible.

Proposal

Introduce a config item, flash.keyspace_name, that binds a TiFlash node to a keyspace:

  • When set, the node reports a keyspace=<name> store label to PD (through the proxy's --labels argument). The label is consumed by client-go's GetTiFlashComputeStores, so a TiDB only dispatches MPP tasks to nodes bound to its keyspace.
  • Nodes without the config keep reporting no such label and remain shared by all keyspaces — fully backward compatible, existing clusters are unaffected.
  • The value is validated at startup with the same rules as PD's keyspace name (^[-A-Za-z0-9_]{1,20}$); an invalid value is a clear startup failure instead of a silently mis-registered node.

Note: this requires a companion change in client-go (KeyspaceLabelKey filter in GetTiFlashComputeStores).

Value
  • Per-keyspace resource isolation for TiFlash compute: dedicated or shared compute pools per keyspace in multi-keyspace clusters.
  • Zero migration cost for existing clusters.
主要语言
C++
星标
1k
派生
428
平均合并
2 天 7 小时
30 天内合并 PR
100

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

pingcap/tiflash 的其他 Issue

查看 pingcap/tiflash 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。