Disk Space Continues to Grow: Merge Does Not Reclaim Disk Space

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 磁盘空间持续增长 merge 未回收磁盘空间

| username: GreenGuan

During inspection, it was found that the disk space reached the alarm threshold due to too many empty regions. Necessary parameter settings have been made to reduce empty regions, but the disk has not shrunk. Using query statements, it was found that the table id in TIKV_REGION_STATUS has a large number of NULLs, and it seems that the changes have not taken effect. Does this NULL actually occupy disk space? And how to clean it up?

mysql> SELECT
    ->     db_name,
    ->     table_name,
    ->     ROUND(SUM(total_size / cnt), 2) Approximate_Size,
    ->     ROUND(SUM(total_size / cnt / (SELECT
    ->                     ROUND(AVG(value), 2)
    ->                 FROM
    ->                     METRICS_SCHEMA.store_size_amplification
    ->                 WHERE
    ->                     value > 0)),
    ->             2) Disk_Size
    -> FROM
    ->     (SELECT
    ->         db_name,
    ->             table_name,
    ->             region_id,
    ->             SUM(Approximate_Size) total_size,
    ->             COUNT(*) cnt
    ->     FROM
    ->         information_schema.TIKV_REGION_STATUS
    ->     GROUP BY db_name , table_name , region_id) tabinfo
    -> GROUP BY db_name , table_name order by Disk_Size;

+--------------------+---------------------------------------------------+------------------+------------+
| db_name            | table_name                                        | Approximate_Size | Disk_Size  |
+--------------------+---------------------------------------------------+------------------+------------+
....
| NULL               | NULL                                              |      15716867.00 | 1866611.28 |

Parameter settings:
store limit all 100
“enable-placement-rules”: “false”,
pd-server. “key-type”: “table”
“enable-cross-table-merge”: “true”,
tikv coprocessor.split-region-on-table false

I also checked that the gc worker is normal.

| username: xfworld | Original post link

Only after GC and when TiKV meets the conditions for compaction will it actually release space…

auto compaction

If you are in a hurry, you can manually compact

It’s best to handle it during non-busy business hours…

| username: GreenGuan | Original post link

Oh, oh, thank you. Also, what does it mean when the table id in TIKV_REGION_STATUS is empty?

| username: xfworld | Original post link

Empty region… There is no business metadata description, only technical metadata.

| username: system | Original post link

This topic will be automatically closed 60 days after the last reply. No new replies are allowed.