After deleting by time field in TiDB cluster, TiKV disk available space remains unchanged

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

Original topic: tidb集群按照时间字段删除后,tikv磁盘可用空间无变化

| username: DBRE

[TiDB Usage Environment] Production Environment
[TiDB Version] 5.2.2
[Encountered Problem: Phenomenon and Impact]
There is a production environment TiDB cluster. Recently, due to the large amount of data, the TiKV storage space has become tight. The business has deleted data from two large tables based on the time field. In the past few days, several billion pieces of data have been deleted from the tables, but the TiKV disk space has not decreased.
What could be the reason for this? From which aspects should we investigate?

[Attachment: Screenshot/Log/Monitoring]

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

Check if the GC has been dropped.

| username: DBRE | Original post link

Which specific metric is it?

| username: xfworld | Original post link

You can refer to the following documents:

| username: DBRE | Original post link

It looks normal.

| username: xfworld | Original post link

Then just observe~ No rush.

| username: 裤衩儿飞上天 | Original post link

Wait for compaction.

| username: DBRE | Original post link

Are these metrics normal?

| username: DBRE | Original post link

What compaction metrics can be viewed on Grafana?

| username: DBRE | Original post link

Is this metric normal?

| username: xfworld | Original post link

The maximum is just 4 minutes, no problem.

Have you reclaimed your space?

If not, it might be a bug causing it. I suggest you upgrade to 5.2.4.

| username: DBRE | Original post link

  1. Space was not reclaimed.
  2. I have a question. The maximum is 4 minutes, but after starting to delete data, the TiDB GC seconds is basically 0. Why is that?
  3. How can we monitor scenarios where GC is not working? Or what metrics can reflect that GC is not working?
| username: DBRE | Original post link

Deleted a few more days of data, and space has started to be reclaimed. However, I have another question: why are TiKV regions increasing? Shouldn’t empty regions be merged? :joy:

| username: xfworld | Original post link

You can independently schedule and accelerate the merging of empty regions…

| username: Raymond | Original post link

Grafana Monitoring Dashboard - TiKV-Details Panel - GC

| username: Raymond | Original post link

You can check out this article