Skip to content

Commit

Permalink
infoschema: don't display tables in MemDB when query `TIDB_HOT_REGION…
Browse files Browse the repository at this point in the history
…S` (#52180)

close #50810
  • Loading branch information
Defined2014 authored Mar 28, 2024
1 parent c0fc3ba commit f58f5e1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/executor/infoschema_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -1949,17 +1949,17 @@ func (e *memtableRetriever) setDataForTiDBHotRegions(ctx context.Context, sctx s
if !ok {
return errors.New("Information about hot region can be gotten only when the storage is TiKV")
}
allSchemas := sctx.GetInfoSchema().(infoschema.InfoSchema).AllSchemas()
tikvHelper := &helper.Helper{
Store: tikvStore,
RegionCache: tikvStore.GetRegionCache(),
}
metrics, err := tikvHelper.ScrapeHotInfo(ctx, helper.HotRead, allSchemas)
schemas := tikvHelper.FilterMemDBs(sessiontxn.GetTxnManager(sctx).GetTxnInfoSchema().AllSchemas())
metrics, err := tikvHelper.ScrapeHotInfo(ctx, helper.HotRead, schemas)
if err != nil {
return err
}
e.setDataForHotRegionByMetrics(metrics, "read")
metrics, err = tikvHelper.ScrapeHotInfo(ctx, helper.HotWrite, allSchemas)
metrics, err = tikvHelper.ScrapeHotInfo(ctx, helper.HotWrite, schemas)
if err != nil {
return err
}
Expand Down

0 comments on commit f58f5e1

Please sign in to comment.