mirror of https://github.com/tikv/client-go.git
Warn when filtering out regions without leaders (#1773)
Signed-off-by: ekexium <eke@fastmail.com>
This commit is contained in:
parent
0172e26932
commit
6da8a064e7
|
|
@ -2425,6 +2425,10 @@ func (c *RegionCache) handleRegionInfos(bo *retry.Backoffer, regionsInfo []*rout
|
|||
for _, r := range regionsInfo {
|
||||
// Leader id = 0 indicates no leader.
|
||||
if needLeader && (r.Leader == nil || r.Leader.GetId() == 0) {
|
||||
logutil.BgLogger().Warn("filter out region without leader",
|
||||
zap.Uint64("regionId", r.Meta.Id),
|
||||
zap.String("startKey", redact.Key(r.Meta.StartKey)),
|
||||
zap.String("endKey", redact.Key(r.Meta.EndKey)))
|
||||
continue
|
||||
}
|
||||
region, err := newRegion(bo, c, r)
|
||||
|
|
@ -2437,7 +2441,7 @@ func (c *RegionCache) handleRegionInfos(bo *retry.Backoffer, regionsInfo []*rout
|
|||
return nil, nil
|
||||
}
|
||||
if len(regions) < len(regionsInfo) {
|
||||
logutil.Logger(context.Background()).Debug(
|
||||
logutil.Logger(context.Background()).Warn(
|
||||
"regionCache: scanRegion finished but some regions has no leader.")
|
||||
}
|
||||
return regions, nil
|
||||
|
|
|
|||
Loading…
Reference in New Issue