Support binding a TiFlash node to a specific keyspace

Đang mở
#11,279 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@ChangRui-Ryan đang làm issue này rồi.

Từ ngày 9/11/2026.

  • #11280 của @ChangRui-Ryan — đang mở

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
42/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
cpp
Lĩnh vực
backend

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.
Ngôn ngữ chính
C++
Star
1k
Fork
428
Merge trung bình
2 ngày 7 giờ
Pull request đã merge (30 ngày)
100

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của pingcap/tiflash

Tất cả issue của pingcap/tiflash

Issue tương tự

Thêm issue về C++

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.