Currently, we use a completely random method to select shards for tables, which will lead to uneven distribution of tables in the cluster when the number of tables is small. In order to solve this problem, a new shardPicker is implemented, which selects the shard with the smallest number of current tables each time to create a table.
Detailed Changes
Add NewLeastTableShardPicker, which selects the shard with the smallest number of current tables each time to create a table.
Test Plan
Pass all unit tests and manually create tables for verification in the local environment.
Rationale
Currently, we use a completely random method to select shards for tables, which will lead to uneven distribution of tables in the cluster when the number of tables is small. In order to solve this problem, a new shardPicker is implemented, which selects the shard with the smallest number of current tables each time to create a table.
Detailed Changes
NewLeastTableShardPicker
, which selects the shard with the smallest number of current tables each time to create a table.Test Plan