Add refresh api to update region cache
- Dominant language
- Go
- Stars
- 40.5k
- Forks
- 6.2k
- PR merge metrics
- PR metrics pending
Description
## Feature Request
**Is your feature request related to a problem? Please describe:**
Now TiDB region cache TTL is 600s. When we rolling update TiKV and evict all TiKV leaders, the region cache may be still outdated.
If we restart the TiKV node immediately after all leaders are evicted, TiDB may send requests to the unavailable TiKV node and then call PD to refresh region cache. It influences latency when rolling update TiKV.
Now TiDB Operator use `Cache TTL` to wait all region caches up to date. However, it's too slow. See https://github.com/pingcap/tidb-operator/pull/7054
**Describe the feature you'd like:**
Add an api to refresh region cache or at least refresh region cache which contains outdated leader.
**Describe alternatives you've considered:**
**Teachability, Documentation, Adoption, Migration Strategy:**
Contributor guide
Research direction
No files or tests are named. Start by tracing TiDB's region-cache TTL and PD refresh path, then read the linked TiDB Operator PR #7054 to understand the rolling-update need. Done means an agreed API refreshes the region cache, or outdated leaders specifically, with coverage for the intended behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api, databases, distributed-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100