Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
hanfei1991 committed May 12, 2021
1 parent af19f02 commit 0c26afc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion store/copr/batch_coprocessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -411,10 +411,15 @@ func (b *batchCopIterator) handleBatchCopResponse(bo *tikv.Backoffer, response *
}

if len(response.RetryRegions) > 0 {
for _, retry := range response.RetryRegions {
logutil.BgLogger().Info("multiple regions are stale and need to be refreshed", zap.Int("region size", len(response.RetryRegions)))
for idx, retry := range response.RetryRegions {
id := tikv.NewRegionVerID(retry.Id, retry.RegionEpoch.ConfVer, retry.RegionEpoch.Version)
logutil.BgLogger().Info("invalid region because tiflash detected stale region", zap.String("region id", id.String()))
b.store.GetRegionCache().InvalidateCachedRegionWithReason(id, tikv.EpochNotMatch)
if idx >= 10 {
logutil.BgLogger().Info("stale regions are too many, so we omit the rest ones")
break
}
}
return
}
Expand Down

0 comments on commit 0c26afc

Please sign in to comment.