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) (#52204)

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

0 comments on commit 33c50c3

Please sign in to comment.