Skip to content

Commit 2ba47d0

Browse files
ekexiumclaude
andcommitted
region_request: log unknown region error for debugging
When regionErrorToLabel returns "unknown", log the full error content along with the RPC context at INFO level. This helps identify new error types that should be handled when "unknown" appears in metrics. The log is placed in onRegionError (the caller) rather than regionErrorToLabel to: 1. Keep regionErrorToLabel as a pure function without side effects 2. Include RPC context information for better debugging 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 9dd1b8e commit 2ba47d0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

internal/locate/region_request.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1926,6 +1926,13 @@ func (s *RegionRequestSender) onRegionError(
19261926
}
19271927

19281928
regionErrLabel := regionErrorToLabel(regionErr)
1929+
if regionErrLabel == "unknown" {
1930+
logutil.Logger(bo.GetCtx()).Info(
1931+
"unknown region error",
1932+
zap.Stringer("error", regionErr),
1933+
zap.Stringer("ctx", ctx),
1934+
)
1935+
}
19291936
metrics.TiKVRegionErrorCounter.WithLabelValues(regionErrLabel, storeIDLabel(ctx)).Inc()
19301937
if s.Stats != nil {
19311938
s.Stats.RecordRPCErrorStats(regionErrLabel)

0 commit comments

Comments
 (0)