tidb-dashboard
tidb-dashboard copied to clipboard
Keyviz: deleted table do not disappear
Bug Report
What did you do?
- I created deleted 2 big tables in my DB (90~95% of DB size)
- Waited 1 day
- I went to Dashboard->Key visualizer
What did you expect to see? Only the existing table stats
What did you see instead? The existing table stats + stats for table_77 and table_177, which I assume are the two deleted tables, since in the same location/size there were the two deleted tables before I deleted them.
What version of TiDB Dashboard are you using (./tidb-dashboard --version)?
I installed with tiup and I do not have tidb-dashboard.
PD version:
release-version=v5.2.0
edition=Community
git-hash=8afd38d919ec727712a9518cc3ebdcab47b2fbcb
git-branch=heads/refs/tags/v5.2.0
utc-build-time="2021-08-26 08:36:35"
Is this by design, or is it undefined behavior? @breeswish
Actually there was no table_77 or table_177 from the beginning. The root cause is that we are decoding the table name from StartKey. Since TiDB v5.x, the Region StartKey may not be a real table key.
This issue can be easily reproduced by importing TPC-H data with a TiFlash replica.
I have found that there are three situations where this problem can occur:
-
After the table is deleted and the dashboard is recovered, the table name map will be cleared. queries from the tidb schema will not contain the schema of the deleted table.

-
As @breeswish says, since TiDB v5.x, the Region StartKey may not be a real table key. So what is implied by StartKey now?
-
The table name can't display within 1min of starting in keyviz.