Why are all regions under one store when creating a table using the pre_split_region parameter?

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

Original topic: 利用pre_split_region参数建表所有的region为什么都在1个store下面

| username: dxss-lee

There are a total of 3 TiKV instances in the cluster, and all the regions are on store 4. Every time I create a table, all the regions are on store 4. What is causing this?

| username: h5n1 | Original post link

When creating a new table or when a new region is split, they are all on the same store. As the load and storage capacity change later, balancing scheduling will be performed. If you want the regions to be distributed to other stores when creating the table, you can use the pre_split_regions or partition method to generate multiple regions for the table. At the same time, set tidb_scatter_region, and the generated regions will be evenly scheduled to other nodes. Additionally, you can try using pd-ctl to set scatter scheduling for the table. Moreover, if the region is too small and reaches the threshold, the region will be merged.

| username: dxss-lee | Original post link

Got it, thanks a lot!

| username: h5n1 | Original post link

tidb_scatter_region is a global variable that will increase the DDL time for creating tables.

| username: dxss-lee | Original post link

It has already been tested. There is a dedicated process for pre-building partitions for partitioned tables, so it is not sensitive to DDL time.

| username: system | Original post link

This topic will be automatically closed 60 days after the last reply. No new replies are allowed.