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

Implement the SWIM membership and gossip protocol #180

Merged
merged 1 commit into from
Jan 28, 2016

Conversation

adamhjk
Copy link
Contributor

@adamhjk adamhjk commented Jan 28, 2016

gif-keyboard-84549493973607935

This commit implements the
SWIM gossip
protocol. We have a few modifications

  • We prefer members to stay alive, rather than dead; if a member
    receives a Confirmed message about itself, it updates its incarnation
    and becomes alive
  • We have the idea of 'permanent' members, which we will attempt to ping
    even if they are confirmed dead. This allows the system to heal from
    partitions, as long as everyone has a permanent member on both sides
    of the split.

To use:

$ bldr start chef/redis --gossip-peer 192.168.1.1

More details:

  • Fixes a bug in bldr-build where we fail to build a docker container for a package if
    the bldr user already exists.
  • Adds chef/rngd to the base bldr docker image.
  • Adds the --gossip-listen, --gossip-peer, and --gossip-permanent
    options
  • Adds errors for JSON encode/decode, and failure to contact initial
    peers.
  • Adds a gossip::client module for outbound communication
  • Adds a gossip::server module for managing the gossip lifecycle
  • Adds inbound, outbound, and failure detection threads to the server
  • Adds functional tests for core gossip functionality, requiring our
    test suite to be run with the NET_ADM privilege in docker.
  • Adds the /gossip sidecar, to get debugging data about the gossip
    layer, opening up all sorts of fun visualizations.

@chef-delivery
Copy link
Contributor

This PR has passed 'Verify' and is ready for review and approval!
Use: '@delivery approve' when code review is complete.

pub fn set_gossip_peer(&mut self, mut gp: Vec<String>) -> &mut Config {
for p in gp.iter_mut() {
if p.find(':').is_none() {
p.push_str(":9634");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be nice to have this magic # as a constant at the top of a file somewhere

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixing it. The only place that is harder is the options themselves - since you use the docstring to get a default, 9634 will be magic there. Probably a good reason to consider moving the whole options thing to Clap.

@bookshelfdave
Copy link
Contributor

awesome :-)

I'm happy to help resolve any conflicts on master.

@adamhjk adamhjk force-pushed the swim-membership-fixed branch from 36d6494 to 3d566b3 Compare January 28, 2016 21:30
@chef-delivery
Copy link
Contributor

This PR has passed 'Verify' and is ready for review and approval!
Use: '@delivery approve' when code review is complete.

@adamhjk adamhjk force-pushed the swim-membership-fixed branch from 3d566b3 to 0e542d4 Compare January 28, 2016 21:58
@reset
Copy link
Collaborator

reset commented Jan 28, 2016

gif-keyboard-3195871100883898494

@chef-delivery
Copy link
Contributor

This PR has passed 'Verify' and is ready for review and approval!
Use: '@delivery approve' when code review is complete.

1 similar comment
@chef-delivery
Copy link
Contributor

This PR has passed 'Verify' and is ready for review and approval!
Use: '@delivery approve' when code review is complete.

This commit implements the
[SWIM](https://www.cs.cornell.edu/~asdas/research/dsn02-swim.pdf) gossip
protocol. We have a few modifications

* We prefer members to stay alive, rather than dead; if a member
  receives a Confirmed message about itself, it updates its incarnation
  and becomes alive
* We have the idea of 'permanent' members, which we will attempt to ping
  even if they are confirmed dead. This allows the system to heal from
  partitions, as long as everyone has a permanent member on both sides
  of the split.

To use:

```
$ bldr start chef/redis --gossip-peer 192.168.1.1
```

More details:

* Fixes a bug in bldr-build where we fail to build a docker container for a package if
  the bldr user already exists.
* Adds chef/rngd to the base bldr docker image.
* Adds the --gossip-listen, --gossip-peer, and --gossip-permanent
  options
* Adds errors for JSON encode/decode, and failure to contact initial
  peers.
* Adds a gossip::client module for outbound communication
* Adds a gossip::server module for managing the gossip lifecycle
* Adds inbound, outbound, and failure detection threads to the server
* Adds functional tests for core gossip functionality, requiring our
  test suite to be run with the NET_ADM privilege in docker.
* Adds the /gossip sidecar, to get debugging data about the gossip
  layer, opening up all sorts of fun visualizations.
* Makes the default gossip port a constant
* Fixes error output for JSON to use Display rather than Debug
@adamhjk adamhjk force-pushed the swim-membership-fixed branch from 0e542d4 to bf92fc7 Compare January 28, 2016 22:05
@chef-delivery
Copy link
Contributor

This PR has passed 'Verify' and is ready for review and approval!
Use: '@delivery approve' when code review is complete.

1 similar comment
@chef-delivery
Copy link
Contributor

This PR has passed 'Verify' and is ready for review and approval!
Use: '@delivery approve' when code review is complete.

@adamhjk
Copy link
Contributor Author

adamhjk commented Jan 28, 2016

gif-keyboard-523241303292493611

@adamhjk
Copy link
Contributor Author

adamhjk commented Jan 28, 2016

@delivery approve

chef-delivery added a commit that referenced this pull request Jan 28, 2016
Merged change b19b1dcf-9c14-4151-be85-61909bb8d5dc

From review branch swim-membership-fixed into master

Signed-off-by: adam <[email protected]>
@chef-delivery chef-delivery merged commit 68d9030 into master Jan 28, 2016
@chef-delivery chef-delivery deleted the swim-membership-fixed branch January 28, 2016 22:33
@chef-delivery
Copy link
Contributor

Change: b19b1dcf-9c14-4151-be85-61909bb8d5dc approved by: @adamhjk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants