MergeRegion Not Working

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

Original topic: MergeRegion 不工作

| username: ddmasato

[TiDB Usage Environment] Production Environment
[TiDB Version] v5.4
[Reproduction Path] Reload Cluster
[Encountered Problem: Phenomenon and Impact]
Region merge scheduling is not working, causing empty regions to continuously increase without merging.
[Resource Configuration]
[Attachments: Screenshots/Logs/Monitoring]


The above image shows the last merge region time.

Performed operations using reload, but it had no effect.

This is the content of config show

| username: 大飞哥online | Original post link

Take a look at SELECT * FROM TIKV_REGION_STATUS WHERE APPROXIMATE_SIZE <= 10.

| username: ddmasato | Original post link

The result is this.

| username: 大飞哥online | Original post link

Use PD-ctl to check the working status of scheduler describe balance-region-scheduler.

| username: xfworld | Original post link

PD is not working, you need to check the region merge configuration:

  1. Whether cross-table merge is allowed
  2. Region merge frequency parameters
  3. Split table feature

Check cross-table parameter configuration:

./pd-ctl config show enable-cross-table-merge

Check region frequency configuration:
patrol-region-interval:
Controls the frequency at which replicaChecker checks the region monitoring status. The shorter the interval, the faster it runs (10ms).

split-merge-interval:
Controls the interval between split and merge operations on the same region. A newly split region will not merge for a period of time (default 1h).


Split table feature: This can cause an issue where after creating a large number of tables (including executing Truncate Table operations) and then clearing them, the regions cannot merge.

  • TiKV: Set split-region-on-table to false. This parameter does not support dynamic modification.

Main reference documents:

| username: Fly-bird | Original post link

Is the issue resolved?

| username: ddmasato | Original post link

Thank you. Following these steps, it might be related to the interval. It has been restored now.

| username: ddmasato | Original post link

Hello, it might be related to the interval. It has been restored now.

| username: zhanggame1 | Original post link

Glad it’s resolved.

| username: ajin0514 | Original post link

PD is not working, you need to check the region merge configuration.

| username: system | Original post link

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