Skip to content
This repository has been archived by the owner on Feb 6, 2024. It is now read-only.

feat: add least table shard picker #248

Merged
merged 5 commits into from
Oct 9, 2023

Conversation

ZuLiangWang
Copy link
Contributor

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

  • 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.

server/coordinator/shard_picker.go Outdated Show resolved Hide resolved
server/coordinator/shard_picker.go Outdated Show resolved Hide resolved
server/coordinator/shard_picker.go Outdated Show resolved Hide resolved
server/coordinator/shard_picker.go Outdated Show resolved Hide resolved
@ZuLiangWang ZuLiangWang force-pushed the uniform_shard_picker branch 2 times, most recently from b44d67b to 35474cb Compare October 9, 2023 08:51
@ShiKaiWi ShiKaiWi merged commit 8da409a into apache:main Oct 9, 2023
4 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants