Support binding a TiFlash node to a specific keyspace

Aperta
#11,279 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@ChangRui-Ryan ci sta già lavorando.

Dal 9/11/2026.

  • #11280 di @ChangRui-Ryan — aperta

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
42/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
cpp
Ambito
backend

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.
Lingua principale
C++
Stelle
1k
Fork
428
Merge medio
2g 7h
PR unite (30g)
100

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di pingcap/tiflash

Tutte le issue di pingcap/tiflash

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.