From cc78ed59300c493e7ae84156a69e800265cf001b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Eeden?= Date: Wed, 22 Mar 2023 09:34:17 +0100 Subject: [PATCH] Log request info for label warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Example: ``` [2023/03/22 09:33:11.663 +01:00] [WARN] [region_request.go:586] ["unable to find stores with given labels"] [labels="[{\"key\":\"zone\",\"value\":\"z1\"}]"] ``` Signed-off-by: Daniƫl van Eeden --- internal/locate/region_request.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/locate/region_request.go b/internal/locate/region_request.go index a10924d890..b736f21325 100644 --- a/internal/locate/region_request.go +++ b/internal/locate/region_request.go @@ -583,7 +583,8 @@ 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") + logutil.BgLogger().Warn("unable to find stores with given labels", + zap.Any("labels", state.option.labels)) } leader := selector.replicas[state.leaderIdx] if leader.isEpochStale() || leader.isExhausted(1) {