Skip to content

Commit

Permalink
tikv: do not refresh TiFlash work index when region is refreshed in c…
Browse files Browse the repository at this point in the history
…ache (#14205)
  • Loading branch information
lzmhhh123 authored and sre-bot committed Dec 26, 2019
1 parent f18abc9 commit 7a024a2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions store/tikv/region_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,9 @@ func (c *RegionCache) UpdateLeader(regionID RegionVerID, leaderStoreID uint64, c
func (c *RegionCache) insertRegionToCache(cachedRegion *Region) {
old := c.mu.sorted.ReplaceOrInsert(newBtreeItem(cachedRegion))
if old != nil {
// Don't refresh TiFlash work idx for region. Otherwise, it will always goto a invalid store which
// is under transferring regions.
cachedRegion.getStore().workTiFlashIdx = old.(*btreeItem).cachedRegion.getStore().workTiFlashIdx
delete(c.mu.regions, old.(*btreeItem).cachedRegion.VerID())
}
c.mu.regions[cachedRegion.VerID()] = cachedRegion
Expand Down

0 comments on commit 7a024a2

Please sign in to comment.