-
Notifications
You must be signed in to change notification settings - Fork 600
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(meta): introduce consistent hash logic #626
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job!
/// Mapping from parallel unit to virtual key, which is volatile. | ||
owner_mapping: HashMap<ParallelUnitId, Vec<VirtualKey>>, | ||
/// Mapping from key count to parallel unit, aiming to maintain load balance. | ||
load_balancer: BTreeMap<usize, Vec<ParallelUnitId>>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's okay to recalculate the load everytime on add/delete node instead of maintaining such a map, which may simplify the implementation.
Codecov Report
@@ Coverage Diff @@
## main #626 +/- ##
============================================
+ Coverage 71.35% 71.43% +0.07%
Complexity 2699 2699
============================================
Files 891 893 +2
Lines 50657 50935 +278
Branches 1723 1723
============================================
+ Hits 36146 36384 +238
- Misses 13699 13739 +40
Partials 812 812
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally LGTM.
Please feel free to click the "Ready for review" button to make it able to merge |
What's changed and what's your intention?
PLEASE DO NOT LEAVE THIS EMPTY !!!
Please explain IN DETAIL what the changes are in this PR and why they are needed:
Summarize your change (mandatory)
ParallelUnit
for eachComputeNode
How does this PR work? Need a brief introduction for the changed logic (optional)
Describe clearly one logical change and avoid lazy messages (optional)
Describe any limitations of the current code (optional)
Checklist
Refer to a related PR or issue link (optional)
#381