add warn log (#308)

Signed-off-by: yisaer <disxiaofei@163.com>
This commit is contained in:
Song Gao 2021-09-18 15:13:19 +08:00 committed by GitHub
parent f4a640e8e0
commit 6ca8098ae0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -545,6 +545,9 @@ func (state *accessFollower) next(bo *retry.Backoffer, selector *replicaSelector
}
// If there is no candidate, fallback to the leader.
if selector.targetIdx < 0 {
if len(state.option.labels) > 0 {
logutil.BgLogger().Warn("unable to find stores with given labels")
}
leader := selector.replicas[state.leaderIdx]
if leader.isEpochStale() || leader.isExhausted(1) {
metrics.TiKVReplicaSelectorFailureCounter.WithLabelValues("exhausted").Inc()