Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: 磁盘空间持续增长 merge 未回收磁盘空间
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.