Skip to content

Commit

Permalink
format key in error message in method scanRegions (#876)
Browse files Browse the repository at this point in the history
Signed-off-by: Chao Wang <cclcwangchao@hotmail.com>
  • Loading branch information
lcwangchao authored Jul 10, 2023
1 parent 32eb2b0 commit 5e3e38b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/locate/region_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -1300,7 +1300,7 @@ func (c *RegionCache) BatchLoadRegionsWithKeyRange(bo *retry.Backoffer, startKey
return
}
if len(regions) == 0 {
err = errors.Errorf("PD returned no region, startKey: %q, endKey: %q", startKey, endKey)
err = errors.Errorf("PD returned no region, startKey: %q, endKey: %q", util.HexRegionKeyStr(startKey), util.HexRegionKeyStr(endKey))
return
}

Expand Down Expand Up @@ -1710,7 +1710,7 @@ func (c *RegionCache) scanRegions(bo *retry.Backoffer, startKey, endKey []byte,
metrics.RegionCacheCounterWithScanRegionsError.Inc()
backoffErr = errors.Errorf(
"scanRegion from PD failed, startKey: %q, limit: %d, err: %v",
startKey,
util.HexRegionKeyStr(startKey),
limit,
err)
continue
Expand All @@ -1721,7 +1721,7 @@ func (c *RegionCache) scanRegions(bo *retry.Backoffer, startKey, endKey []byte,
if len(regionsInfo) == 0 {
return nil, errors.Errorf(
"PD returned no region, startKey: %q, endKey: %q, limit: %d",
startKey, endKey, limit,
util.HexRegionKeyStr(startKey), util.HexRegionKeyStr(endKey), limit,
)
}
regions := make([]*Region, 0, len(regionsInfo))
Expand Down

0 comments on commit 5e3e38b

Please sign in to comment.