-
Notifications
You must be signed in to change notification settings - Fork 410
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
*: add quorum package #380
Conversation
Adds quorum package and majority configuration. Configuration in tracker is also updated. The quorum package is ported from etcd master. Signed-off-by: Jay Lee <BusyJayLee@gmail.com>
@Fullstop000 Do you have time to review this? You can use command "LGTM" to give your approval. |
return (u64::MAX, false); | ||
} | ||
|
||
let mut stack_arr: [MaybeUninit<Index>; 7] = unsafe { MaybeUninit::uninit().assume_init() }; |
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 prefer SmallVec
for this.
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 didn't use SmallVec
on purpose. On the one hand, it's such a small piece of code that doesn't need to introduce another dependency; on the other hand, it has less condition branch as every operation is inlined and optimized when using array.
@@ -199,7 +165,7 @@ impl ProgressSet { | |||
let pr = Progress::new(next_idx, max_inflight); | |||
for id in &meta.conf_state.as_ref().unwrap().voters { | |||
self.progress.insert(*id, pr.clone()); | |||
self.configuration.voters.insert(*id); | |||
self.configuration.voters.voters.insert(*id); |
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 looks wired... Is there potential extra fields in Configuration
besides voters
?
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.
Yes. It will be added when Joint configuration is ported.
} | ||
} | ||
|
||
pub trait AckedIndexer { |
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.
It could be better to add some comments for this public trait
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.
It's not a public trait. It can only be accessed by the crate. We have #![deny(missing_docs)]
check.
LGTM |
Adds quorum package and majority configuration. Configuration in tracker
is also updated. The quorum package is ported from etcd master.