Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .vs/slnx.sqlite
Binary file not shown.
Binary file added .vs/slnx.sqlite-journal
Binary file not shown.
13 changes: 9 additions & 4 deletions internal/locate/region_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -2224,8 +2224,8 @@ func (c *RegionCache) scanRegions(bo *retry.Backoffer, startKey, endKey []byte,
metrics.LoadRegionCacheHistogramWithRegions.Observe(time.Since(start).Seconds())
if err != nil {
if apicodec.IsDecodeError(err) {
return nil, errors.Errorf("failed to decode region range key, limit: %d, err: %v",
limit, err)
return nil, errors.Errorf("failed to decode region range key, limit: %d, startKey: %q, endKey: %q, err: %v",
limit, redact.Key(startKey), redact.Key(endKey), err)
}
metrics.RegionCacheCounterWithScanRegionsError.Inc()
backoffErr = errors.Errorf(
Expand Down Expand Up @@ -2299,9 +2299,14 @@ func (c *RegionCache) batchScanRegions(bo *retry.Backoffer, keyRanges []router.K
return c.batchScanRegionsFallback(bo, keyRanges, limit, opts...)
}
if apicodec.IsDecodeError(err) {
return nil, errors.Errorf("failed to decode region range key, range num: %d, limit: %d, err: %v",
len(keyRanges), limit, err)
var b strings.Builder
for i, kr := range keyRanges {
fmt.Fprintf(&b, "[%d] start: %q, end: %q; ", i, redact.Key(kr.StartKey), redact.Key(kr.EndKey))
}
return nil, errors.Errorf("failed to decode region range key, range num: %d, limit: %d, keyRanges: %s, err: %v",
len(keyRanges), limit, b.String(), err)
}

metrics.RegionCacheCounterWithBatchScanRegionsError.Inc()
backoffErr = errors.Errorf(
"batchScanRegion from PD failed, range num: %d, limit: %d, err: %v",
Expand Down