Skip to content

Commit

Permalink
address comment
Browse files Browse the repository at this point in the history
Signed-off-by: bufferflies <[email protected]>
  • Loading branch information
bufferflies committed Aug 21, 2023
1 parent f89b49e commit 657aa50
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
20 changes: 0 additions & 20 deletions internal/locate/region_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -2117,26 +2117,6 @@ func (c *RegionCache) InvalidateTiFlashComputeStores() {
c.tiflashComputeStoreMu.needReload = true
}

// UpdateBucketOnError updates the buckets of the region in the cache if meets the buckets version not match.
func (c *RegionCache) UpdateBucketOnError(regionID RegionVerID, version uint64, keys [][]byte) {
r := c.GetCachedRegionWithRLock(regionID)
if r == nil {
return
}

buckets := r.getStore().buckets
var bucketsVer uint64
if buckets != nil {
bucketsVer = buckets.GetVersion()
}
if bucketsVer < version {
c.mu.Lock()
buckets.Version = version
buckets.Keys = keys
c.mu.Unlock()
}
}

// UpdateBucketsIfNeeded queries PD to update the buckets of the region in the cache if
// the latestBucketsVer is newer than the cached one.
func (c *RegionCache) UpdateBucketsIfNeeded(regionID RegionVerID, latestBucketsVer uint64) {
Expand Down
2 changes: 1 addition & 1 deletion internal/locate/region_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -2039,7 +2039,7 @@ func (s *RegionRequestSender) onRegionError(
}

if bucketVersionNotMatch := regionErr.GetBucketVersionNotMatch(); bucketVersionNotMatch != nil {
logutil.BgLogger().Debug(
logutil.Logger(bo.GetCtx()).Debug(
"tikv reports `BucketVersionNotMatch` retry later",
zap.Stringer("bucketVersionNotMatch", bucketVersionNotMatch),
zap.Stringer("ctx", ctx),
Expand Down

0 comments on commit 657aa50

Please sign in to comment.