pingcap / tidb

TiDB - the open-source, cloud-native, distributed SQL database designed for modern applications.
https://pingcap.com
Apache License 2.0
37.2k stars 5.84k forks source link

region distribution not balance in create table with enable `tidb_scatter_region` in cluster level #55184

Closed River2000i closed 1 month ago

River2000i commented 2 months ago

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

  1. enable tidb_scatter_region
  2. create table to split region

2. What did you expect to see? (Required)

region distribution should balance in cluster level

3. What did you see instead (Required)

image

  1. create table t1 (a int, b int,index idx1(a)) shard_row_id_bits = 10 pre_split_regions=8;
  2. create table t1 (a int, b int,index idx1(a));
  3. create table t1 (a int, b int,index idx1(a)) PARTITION BY RANGE(b) PARTITION p0 VALUES LESS THAN (10),PARTITION p1 VALUES LESS THAN (20));

    4. What is your TiDB version? (Required)

    mysql> select version();
    +--------------------+
    | version()          |
    +--------------------+
    | 8.0.11-TiDB-v8.2.0 |
    +--------------------+
    1 row in set (0.04 sec)
River2000i commented 2 months ago

/assign @River2000i

River2000i commented 1 month ago

/label affects-8.1

River2000i commented 1 month ago

/label affects-7.5 /label affects-7.1 /label affects-6.5 /label affects-6.1 /label affects-5.4