Issues Related to TiKV Space Usage and Garbage Collection

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

Original topic: 关于tikv的空间占用和gc的问题

| username: zhanggame1

[Test Environment for TiDB] Testing
[TiDB Version] 7.1
[Encountered Issue: Phenomenon and Impact]

Test Environment: Single-machine test with 3-node TiKV
Test Content: Create a table, insert 10 million rows, then truncate.

With the default GC setting of 10 minutes, after truncating the table with 10 million rows and waiting for half an hour, the disk space usage did not decrease.
Usage as follows:

Upon inspection, besides SST files, there were also a large number of log files occupying space.

After restarting the cluster, only one log file remained, and the disk space usage was released.

I would like to ask when the log files will be recycled, how long it takes for GC to release disk space, and why the raft log, which is not business data, occupies the most space.

| username: cassblanca | Original post link

The MVCC mechanism does not directly reclaim space.

| username: zhanggame1 | Original post link

The default GC is 10 minutes, but after waiting for half an hour, there is no response.

| username: redgame | Original post link

This parameter, at some time after ten minutes

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

There is another parameter, how often to trigger GC.

| username: xfworld | Original post link

If you want to reclaim space immediately after an operation, you need to refer to the manual commands for using TiKV. You can refer to the official documentation:

For the principles, you can refer to [Some Ideas and Prospects for TiDB Development Operations]

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.