-
Notifications
You must be signed in to change notification settings - Fork 24
Improve raftReplDev creation #695
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
Conversation
|
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #695 +/- ##
===========================================
+ Coverage 56.51% 66.75% +10.24%
===========================================
Files 108 109 +1
Lines 10300 11519 +1219
Branches 1402 1574 +172
===========================================
+ Hits 5821 7690 +1869
+ Misses 3894 3076 -818
- Partials 585 753 +168 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
xiaoxichen
left a comment
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.
Reading this doc https://github.com/eBay/NuRaft/blob/1c2587f159775a4924573db64ffac5c973230761/docs/leader_election_priority.md#L16
I am concerning of open the priority of int32 to CM, as without understanding the implementation detail it probabaly set < int32_max, 1, 0> which will be a nightmare for leader election.
Probabaly HO can still provide a list of replica_id_t and HS decide the priority based on the internal knowledge, we can make the K configurable where K = round of election timeout needed.
Decay = (0.8^k) , for example K =2 make it <10000, 6400, 4096 >. (each with 0.64 decay meaning 2 election timeout).
Good point, and the gap should be bigger than 10. Regarding to
I think option2 is simpler and more controllable. |
|
Yes we discussed this a bit in CM meeting, currently there is no use-case we want to control the secondary-leader.
So basically it is your approach 2 |
| auto max_wait_round = std::min(raft_priority_election_round_upper_limit, | ||
| HS_DYNAMIC_CONFIG(consensus.max_wait_rounds_of_priority_election)); | ||
| if (max_wait_round == 0) { return raft_leader_priority; } | ||
| auto priority = 1 + static_cast< int32_t >( |
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.
this is a nice formula
Use user-defined config(e.g. priority) to create raftReplDev.