Enhancement Task
Problem
Adding or deleting one canonical keyspace region-label rule rebuilds and sorts the complete generic range index while holding the RegionLabeler exclusive lock. Scheduling Service repeats that rebuild after its etcd watch event. At large keyspace counts this makes single-keyspace operations and restart readiness depend on O(K log K) work and a high transient memory peak.
Expected behavior
- A single keyspace-rule add/delete does not traverse or sort all existing rules.
- RawKV-disabled and RawKV-enabled label semantics remain unchanged.
- Startup indexing has bounded memory and a documented readiness target.
- Scale benchmarks cover startup and lock-held single-rule updates at 100k and 1M rules.
This is the upstream counterpart of https://github.com/tidbcloud/pd-cse/issues/560.
Enhancement Task
Problem
Adding or deleting one canonical keyspace region-label rule rebuilds and sorts the complete generic range index while holding the RegionLabeler exclusive lock. Scheduling Service repeats that rebuild after its etcd watch event. At large keyspace counts this makes single-keyspace operations and restart readiness depend on O(K log K) work and a high transient memory peak.
Expected behavior
This is the upstream counterpart of https://github.com/tidbcloud/pd-cse/issues/560.