Skip to content
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

Merged
merged 1 commit into from
Jul 1, 2020
Merged

*: add quorum package #380

merged 1 commit into from
Jul 1, 2020

Conversation

BusyJay
Copy link
Member

@BusyJay BusyJay commented Jun 26, 2020

Adds quorum package and majority configuration. Configuration in tracker
is also updated. The quorum package is ported from etcd master.

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>
@BusyJay BusyJay requested review from hicqu and gengliqi and removed request for hicqu June 26, 2020 11:55
@BusyJay
Copy link
Member Author

BusyJay commented Jun 29, 2020

@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() };
Copy link
Contributor

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.

Copy link
Member Author

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);
Copy link
Member

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 ?

Copy link
Member Author

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 {
Copy link
Member

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

Copy link
Member Author

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.

@Fullstop000
Copy link
Member

LGTM

@BusyJay BusyJay merged commit 5ca2e46 into tikv:master Jul 1, 2020
@BusyJay BusyJay deleted the quorum branch July 1, 2020 11:19
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants