Skip to content

Tables size as on "information_schema.tables" not updated correctly after upgrade to v8.5.1 #60636

@jyteh407

Description

@jyteh407

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

  1. Upgrade TiDB from v7.5.3 to v8.5.1 in 3 4CPU/16GB RAM AWS EC2 Tidb cluster (Rocky Linux 9.5) (I've around 30 -40GB of data)
  2. after upgraded , below table size all show as 0 . It seems to be updated in a very slow progress and forever never being . updated
SELECT table_schema "DB Name",       SUM(data_length + index_length) `Size (Bytes)`,      ROUND(SUM((data_length + index_length) / 1024 / 1024), 2) `Size (MB)` FROM information_schema.tables  GROUP BY table_schema ORDER BY SUM(data_length + index_length) DESC;

I've manually analyze all tables in that 3 instances ...the size are not the same . Below as ref only
Instance 1

+----------------------------+--------------+-----------+
| DB Name                    | Size (Bytes) | Size (MB) |
+----------------------------+--------------+-----------+
| payment_test               |   7478698197 |   7132.24 |
| yuletong_dev               |   6861473243 |   6543.61 |

Instance 2

+----------------------------+--------------+-----------+
| DB Name                    | Size (Bytes) | Size (MB) |
+----------------------------+--------------+-----------+
 payment_test               |   8265354978 |   7882.46 |
 yuletong_dev               |            0 |      0.00 |

2. What did you expect to see?

All tables size are correctly shown in 3 TiDB instances.

3. What did you see instead (Required)

I've manually analyze all tables in that 3 instances ...the size are not the same . Below as ref only
Instance 1

+----------------------------+--------------+-----------+
| DB Name                    | Size (Bytes) | Size (MB) |
+----------------------------+--------------+-----------+
| payment_test               |   7478698197 |   7132.24 |
| yuletong_dev               |   6861473243 |   6543.61 |

Instance 2

+----------------------------+--------------+-----------+
| DB Name                    | Size (Bytes) | Size (MB) |
+----------------------------+--------------+-----------+
 payment_test               |   8265354978 |   7882.46 |
 yuletong_dev               |            0 |      0.00 |

And if I restarted tidb service , the tables size will be reset to 0 and being calculated again .

4. What is your TiDB version? (Required)

mysql>  SELECT tidb_version();
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version()                                                                                                                                                                                                                               |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v8.5.1
Edition: Community
Git Commit Hash: fea86c8e35ad4a86a5e1160701f99493c2ee547c
Git Branch: HEAD
UTC Build Time: 2025-01-16 07:38:34
GoVersion: go1.23.4
Race Enabled: false
Check Table Before Drop: false
Store: tikv |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql>

Metadata

Metadata

Assignees

No one assigned

    Labels

    component/ddlThis issue is related to DDL of TiDB.type/bugThe issue is confirmed as a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions