Empty Regions Generated by Placement Policy SQL Pre-Allocation for Empty Partitions Cannot Be Merged

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

Original topic: Placement Policy SQL 对空分区提前做分配时,产生的 Empty Region 无法被 Merge

| username: linw1995

[TiDB Usage Environment] Production Environment
[TiDB Version] 6.5.2
[Reproduction Path] Placement Policy SQL pre-allocates strategy for empty partitions
[Encountered Problem: Problem Phenomenon and Impact]

The generated Empty Region cannot be merged by Merge Region. After manually operating successfully through pd operator add merge-region, it will split again after a while, producing two Empty Regions.

Undersize regions also have this problem, causing the number of these regions to not decrease when monitoring.

| username: ljluestc | Original post link

After manually merging regions using the pd operator add merge-region command, the resulting split regions became two empty regions. This issue also affects undersized regions, causing the monitored region count to not decrease as expected.

To troubleshoot and resolve this issue, I recommend the following steps:

  1. Verify TiDB Cluster Status: Check the cluster status to ensure all components (including TiDB, PD, and TiKV) are running without any errors or warnings. Use the following commands to verify the status of each component:

    • tidb-ctl display-cluster
    • pd-ctl config show all
    • tikv-ctl --host <tikv_host> --port <tikv_port> store
  2. Check PD Logs: Inspect the PD log files for any relevant error messages or warnings that might reveal the issue. Look for messages related to region splitting, merging, or empty regions. Log files are typically located in the PD data directory.

  3. Monitor Region Distribution: Use the PD API or TiDB Dashboard to monitor region distribution. Pay attention to the number and size distribution of regions. This will help identify if any specific regions or areas are behaving abnormally.

  4. Check the Placement Rules: Review the placement rules configured in the TiDB cluster. Ensure the rules are correctly defined and assigned to the required partitions. Incorrect or conflicting placement rules may cause unexpected region behavior.

  5. Analyze Region Split and Merge Process: Use the PD API or TiDB Dashboard to monitor the region split and merge process. This will provide insights into the sequence of events leading to the generation of empty regions. Look for any patterns or specific conditions triggering the issue.

  6. Verify TiDB Configuration: Check the TiDB configuration settings related to region splitting and merging. Ensure the parameters are set correctly and align with your cluster requirements. Pay attention to configurations such as split-region-on-table, enable-one-way-merge, and max-merge-region-size.

  7. Upgrade TiDB Version: Consider upgrading to a newer version of TiDB that includes bug fixes and improvements related to region splitting and merging. Check the release notes and changelog for the version you are using to see if there are any known issues related to this problem.

| username: redgame | Original post link

Please send the logs.

| username: Anna | Original post link