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

feat: change how region id maps to region worker #3384

Merged
merged 2 commits into from Feb 26, 2024

Conversation

waynexia
Copy link
Member

I hereby agree to the terms of the GreptimeDB CLA

What's changed and what's your intention?

Change the static region worker mapping method. Remove hashing and use modulo instead.

Hashing mapping is not quite predictable. The new mapping considers table id and region number separately, so regions from one table won't get into the same worker.

This is a workaround and the workload skew problem still exists, and will exist if we don't support mechanisms like work stealing or dynamic mapping.

Checklist

  • I have written the necessary rustdoc comments.
  • I have added the necessary unit tests and integration tests.
  • This PR does not require documentation updates.

Refer to a related PR or issue link (optional)

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
@github-actions github-actions bot added the docs-not-required This change does not impact docs. label Feb 26, 2024
src/mito2/src/worker.rs Outdated Show resolved Hide resolved
Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
Copy link

codecov bot commented Feb 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.30%. Comparing base (2035e7b) to head (25e80a2).
Report is 12 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3384      +/-   ##
==========================================
- Coverage   85.38%   85.30%   -0.09%     
==========================================
  Files         891      893       +2     
  Lines      145544   147207    +1663     
==========================================
+ Hits       124276   125572    +1296     
- Misses      21268    21635     +367     

Copy link
Collaborator

@fengjiachun fengjiachun left a comment

Choose a reason for hiding this comment

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

LGTM

@zhongzc zhongzc added this pull request to the merge queue Feb 26, 2024
Merged via the queue into GreptimeTeam:main with commit ce397eb Feb 26, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs-not-required This change does not impact docs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants