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

Bundle #64

Merged
merged 9 commits into from Jul 21, 2015

Conversation

Projects
None yet
3 participants
@danburkert
Copy link
Contributor

danburkert commented Jul 16, 2015

This is a work-in-progress to expand the example application to be a replicated
mutable register. The goal is to have as simple an example as possible while
still demonstrating the power of distributed consensus. When done, the example
will also be useful for integration tests.

@Hoverbear

This comment has been minimized.

Copy link
Owner

Hoverbear commented Jul 16, 2015

Looks great so far!

danburkert added some commits Jul 16, 2015

Expand example into a register server
This is a work-in-progress to expand the example application to be a replicated
mutable register. The goal is to have as simple an example as possible while
still demonstrating the power of distributed consensus. When done, the example
will also be useful for integration tests.
Tweak logging messages; remove scopes from connection.rs
The connection.rs logging scopes were hard to follow, and since each
call method on Connection is typically a leaf-call, scopes are not
necessary. For now Connection scopes are removed, if the call graph on
Connection methods gets more complicated in the future the scopes may
need to be added back.
Fix append_entries_response assertion error
It is possible for a replica to receive a AppendEntries::stale_term
response with a term matching the local term in the case of a delayed
message.

@danburkert danburkert force-pushed the danburkert:master branch from a3c8a07 to 7280656 Jul 20, 2015

@danburkert danburkert changed the title Expand example into a register server Bundle Jul 20, 2015

@danburkert

This comment has been minimized.

Copy link
Contributor

danburkert commented Jul 20, 2015

I've expanded this with a bunch of recent work.

@Hoverbear

This comment has been minimized.

Copy link
Owner

Hoverbear commented Jul 20, 2015

@danburkert Looks good to me. Let me know when it's ready for an r+?

@danburkert

This comment has been minimized.

Copy link
Contributor

danburkert commented Jul 21, 2015

It's pretty much ready. I will have more commits coming eventually, but they aren't necessarily related to these.

@Hoverbear

This comment has been minimized.

Copy link
Owner

Hoverbear commented Jul 21, 2015

Ok, I'll review and merge.

@@ -91,7 +91,7 @@ impl Connection {
kind: ConnectionKind::Unknown,
addr: addr,
stream: socket,
backoff: Backoff::with_duration_range(8, 10000),
backoff: Backoff::with_duration_range(50, 10000),

This comment has been minimized.

@Hoverbear

Hoverbear Jul 21, 2015

Owner

It might be good to make these const instead of magic numbers.

@@ -224,12 +225,12 @@ pub fn proposal_response_unknown_leader() -> Rc<MallocMessageBuilder> {
Rc::new(message)
}

pub fn proposal_response_not_leader(leader_hint: &str) -> Rc<MallocMessageBuilder> {
pub fn proposal_response_not_leader(leader_hint: &SocketAddr) -> Rc<MallocMessageBuilder> {

This comment has been minimized.

@Hoverbear

Hoverbear Jul 21, 2015

Owner

+1 I prefer this.

assert!(replicas[&replica_ids[4]].is_follower());
assert!(replicas[&replica_ids[5]].is_follower());
assert!(replicas[&replica_ids[6]].is_follower());
fn test_election() {

This comment has been minimized.

@Hoverbear

Hoverbear Jul 21, 2015

Owner

Much better!

@@ -23,6 +24,8 @@ pub enum ReplicaState {
pub struct LeaderState {
next_index: HashMap<ServerId, LogIndex>,
match_index: HashMap<ServerId, LogIndex>,
/// Stores in-flight client proposals.
pub proposals: VecDeque<(ClientId, LogIndex)>,

This comment has been minimized.

@Hoverbear

Hoverbear Jul 21, 2015

Owner

Awesome, this is what I was thinking too. A VecDeque is a good structure for this.

@Hoverbear

This comment has been minimized.

Copy link
Owner

Hoverbear commented Jul 21, 2015

@homu r+

@homu

This comment has been minimized.

Copy link
Collaborator

homu commented Jul 21, 2015

📌 Commit 7280656 has been approved by Hoverbear

@homu

This comment has been minimized.

Copy link
Collaborator

homu commented Jul 21, 2015

⌛️ Testing commit 7280656 with merge 32084d0...

homu added a commit that referenced this pull request Jul 21, 2015

Auto merge of #64 - danburkert:master, r=Hoverbear
Bundle

This is a work-in-progress to expand the example application to be a replicated
mutable register. The goal is to have as simple an example as possible while
still demonstrating the power of distributed consensus. When done, the example
will also be useful for integration tests.
@homu

This comment has been minimized.

Copy link
Collaborator

homu commented Jul 21, 2015

☀️ Test successful - status

@homu homu merged commit 7280656 into Hoverbear:master Jul 21, 2015

3 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+3.05%) to 85.491%
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment