Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

store/tikv: no need to manually drop region when RPC call fails. #5402

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions store/tikv/region_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -463,16 +463,6 @@ func (c *RegionCache) OnRequestFail(ctx *RPCContext, err error) {
c.storeMu.Lock()
delete(c.storeMu.stores, storeID)
c.storeMu.Unlock()

log.Infof("drop regions of store %d from cache due to request fail, err: %v", storeID, err)

c.mu.Lock()
for id, r := range c.mu.regions {
if r.region.peer.GetStoreId() == storeID {
c.dropRegionFromCache(id)
}
}
c.mu.Unlock()
}

// OnRegionStale removes the old region and inserts new regions into the cache.
Expand Down
4 changes: 0 additions & 4 deletions store/tikv/region_cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,6 @@ func (s *testRegionCacheSuite) TestRequestFail2(c *C) {
c.Assert(s.cache.storeMu.stores, HasLen, 1)
s.checkCache(c, 2)
s.cache.OnRequestFail(ctx, errors.New("test error"))
// Both region2 and store should be dropped from cache.
c.Assert(s.cache.storeMu.stores, HasLen, 0)
c.Assert(s.cache.searchCachedRegion([]byte("x")), IsNil)
s.checkCache(c, 1)
}

func (s *testRegionCacheSuite) TestUpdateStoreAddr(c *C) {
Expand Down