Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shuffle the segments when rebalancing the table to avoid creating hotspot servers #5197

Merged
merged 1 commit into from Mar 31, 2020

Conversation

Jackie-Jiang
Copy link
Contributor

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.

…spot servers

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.
Copy link
Contributor

@snleee snleee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Jackie-Jiang Jackie-Jiang merged commit 95e0f1d into apache:master Mar 31, 2020
@Jackie-Jiang Jackie-Jiang deleted the replica_group_rebalancer branch March 31, 2020 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants