diff --git a/internal/locate/region_cache.go b/internal/locate/region_cache.go index d50ca3f02..85f8c23d1 100644 --- a/internal/locate/region_cache.go +++ b/internal/locate/region_cache.go @@ -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) { diff --git a/internal/locate/region_request.go b/internal/locate/region_request.go index 030c999e0..fc4e51bba 100644 --- a/internal/locate/region_request.go +++ b/internal/locate/region_request.go @@ -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),