How to Clean Up When TiDB Cluster TiKV Node Disk is Full

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

Original topic: TIDB集群tikv节点磁盘写满,如何清理

| username: 云深不知处

[TiDB Usage Environment] Test/PoC
[TiDB Version] v6.1.0
[Reproduction Path] /home/tidb/tidb-data/tikv-20160/db
[Encountered Issue] TiDB cluster TiKV node disk is about to be full
[Resource Configuration]
[Attachments: Screenshots/Logs/Monitoring]



| username: xfworld | Original post link

Refer to this post:


It’s best to plan disk space in advance…

| username: Jiawei | Original post link

  1. Reduce the retention time for historical data versions.
  2. Determine if it can be cleaned up, alter table compact.
  3. Expand the disk capacity.
| username: 裤衩儿飞上天 | Original post link

Expand TiKV nodes or disks

| username: 我是咖啡哥 | Original post link

Files in the data directory cannot be deleted directly.
If you need to clear table data, you can use drop or truncate to free up some space.
Otherwise, consider expanding the storage.

| username: xingzhenxiang | Original post link

  1. There should be a good data disk plan.
  2. Reasonable monitoring and alerts, such as an 80% usage alert.
| username: 啦啦啦啦啦 | Original post link

Prepare to scale out or archive the data.

| username: tidb菜鸟一只 | Original post link

Do not delete data files from the operating system level. You can set the GC time by using SET GLOBAL tidb_gc_life_time=“60m”; to let the system automatically reclaim space.

| username: h5n1 | Original post link

For urgent handling, you can delete some .log files and placeholder files to free up space. For a long-term solution, you still need to expand the capacity.

| username: 云深不知处 | Original post link

Okay, thank you. Preparing to expand the disk.

| username: 云深不知处 | Original post link

Thanks, I’m preparing to expand.

| username: 云深不知处 | Original post link

Thank you all for your valuable suggestions. I have decided to expand the disk capacity.

| username: 会飞的土拨鼠 | Original post link

  1. You can delete some log files.
  2. Disk expansion.
| username: zhouzeru | Original post link

Expand it.