Skip to content

Commit

Permalink
Log request info for label warning
Browse files Browse the repository at this point in the history
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 <git@myname.nl>
  • Loading branch information
dveeden committed Mar 22, 2023
1 parent 2e8d7a2 commit cc78ed5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/locate/region_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit cc78ed5

Please sign in to comment.