Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/tikv/client-go into remov…
Browse files Browse the repository at this point in the history
…e-replica-selector-v1
  • Loading branch information
crazycs520 committed Apr 7, 2024
2 parents 0d52c70 + abc9bb2 commit 11f2818
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions internal/locate/region_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -2164,10 +2164,11 @@ func (c *RegionCache) PDClient() pd.Client {
return c.pdClient
}

// GetTiFlashStores returns the information of all tiflash nodes.
// GetTiFlashStores returns the information of all tiflash nodes. Like `GetAllStores`, the method only returns resolved
// stores so that users won't be bothered by tombstones. (related issue: https://github.com/pingcap/tidb/issues/46602)
func (c *RegionCache) GetTiFlashStores(labelFilter LabelFilter) []*Store {
return c.filterStores(nil, func(s *Store) bool {
return s.storeType == tikvrpc.TiFlash && labelFilter(s.labels)
return s.storeType == tikvrpc.TiFlash && labelFilter(s.labels) && s.getResolveState() == resolved
})
}

Expand Down
2 changes: 1 addition & 1 deletion internal/locate/store_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ func (s *Store) reResolve(c storeCache) (bool, error) {
if store == nil || store.GetState() == metapb.StoreState_Tombstone {
// store has be removed in PD, we should invalidate all regions using those store.
logutil.BgLogger().Info("invalidate regions in removed store",
zap.Uint64("store", s.storeID), zap.String("add", s.addr))
zap.Uint64("store", s.storeID), zap.String("addr", s.addr))
atomic.AddUint32(&s.epoch, 1)
s.setResolveState(tombstone)
metrics.RegionCacheCounterWithInvalidateStoreRegionsOK.Inc()
Expand Down

0 comments on commit 11f2818

Please sign in to comment.