-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Shuffle the segments when rebalancing the table to avoid creating hot…
…spot servers (#5197) When new servers are added to an existing replica-group based table and rebalance is triggered, current behavior will assign segments in alphabetical order, which might move only the new segments to the new added servers. Because queries tend to query the most recent segments, this behavior might cause new added servers to become the hotspot servers. To address this issue, we shuffle the segments so that old and new segments can be balanced assigned. We use the hash of the table name as the random seed to shuffle the segments so that the result is deterministic. It is a little bit tricky to write a test case for this. Since the change is straight-forward and the existing tests already have pretty good coverage, after manually verified the expected behavior, no new test is added.
- Loading branch information
1 parent
67c30ed
commit 95e0f1d
Showing
4 changed files
with
41 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters