pingcap / pingcap/tidb

Add refresh api to update region cache

Open
#70,998 1 comment 0 reactions 0 assignees View on GitHub
type/feature-request
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.