You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For leader reads, when TiKV returns ServerIsBusy without EstimatedWaitMs (e.g. unified read pool full / MaxPendingTasksExceeded), replicaSelectorV2 does not switch to other replicas and does not invalidate the region cache. It only marks the store slow, backs off (BoTiKVServerBusy), and retries the same cached leader.
This becomes a severe availability gap when the cached leader store is half-dead:
Raft / PD has already transferred leaders away from that store
metrics also showed: after leader count on the store dropped to 0, unified read-pool running tasks stayed high with ~0 CPU, while gRPC was still alive — consistent with returning ServerIsBusy instead of NotLeader.
Expected behavior
When a leader-read hits ServerIsBusy (especially with EstimatedWaitMs == 0) repeatedly on the cached leader, client-go should do one of:
Invalidate / refresh region cache (so a later attempt can discover the new leader), or
Fail over to other replicas (follower read / reload leader from PD), instead of backoff+retrying the same peer only.
Impact
Leader eviction / slow-store protection on the PD/Raft side cannot fully protect TiDB latency if the half-dead store keeps answering ServerIsBusy and the client never updates its leader cache.
Description
For leader reads, when TiKV returns
ServerIsBusywithoutEstimatedWaitMs(e.g. unified read pool full /MaxPendingTasksExceeded), replicaSelectorV2 does not switch to other replicas and does not invalidate the region cache. It only marks the store slow, backs off (BoTiKVServerBusy), and retries the same cached leader.This becomes a severe availability gap when the cached leader store is
half-dead:async_snapshotforever(Running tasks in unified read pool continue to grow while CPU usage is very low tikv#18491) which will lead to increasing running tasks(never done and will not timeout)gRPCand returnServerIsBusybefore Raft-levelNotLeaderchecksclient-go/internal/locate/replica_selector.go
Lines 483 to 526 in 4d50d67
metrics also showed: after leader count on the store dropped to 0, unified read-pool running tasks stayed high with ~0 CPU, while gRPC was still alive — consistent with returning
ServerIsBusyinstead ofNotLeader.Expected behavior
When a leader-read hits ServerIsBusy (especially with EstimatedWaitMs == 0) repeatedly on the cached leader, client-go should do one of:
Impact
Leader eviction / slow-store protection on the PD/Raft side cannot fully protect TiDB latency if the half-dead store keeps answering ServerIsBusy and the client never updates its leader cache.
workaround:
stop the
half-deadtikv instance