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

closes #432 #433

Merged
merged 1 commit into from
Apr 28, 2017
Merged

Conversation

majormoses
Copy link
Contributor

@majormoses majormoses commented Apr 19, 2017

This adds some helper functions to allow a wrapper cookbook to implement removing a node from a cluster in 2 scenarios:

  • removing self from cluster (helpful for normal decommission)
  • removing any node from cluster (helpful for abruptly terminated machines)

These both should not be actually consumed in this cookbook and simply be provided for wrappers to use as they see fit. This should be implemented only after careful thought, design, testing, etc.

@majormoses majormoses force-pushed the feature/rmq-cluster-leave branch from 9ae91c7 to 14faa34 Compare April 19, 2017 16:37
module Helpers
require 'mixlib/shellout'

def remove_self_from_cluster
Copy link
Member

Choose a reason for hiding this comment

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

This name is not particularly correct. You are resetting the node here, which does not notify the rest of the cluster that the node is gone (and can be used in more scenarios).

Copy link
Contributor Author

@majormoses majormoses Apr 19, 2017

Choose a reason for hiding this comment

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

Interesting, according to the documentation I see:

I don't see anything that suggests that it does not communicate these changes back to to cluster, is there something I am missing or do we need to enhance the documentation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

@majormoses yes, peers won't list a node that was reset as an online peer. Are you sure that they also won't list it as an offline one? I see the same assumption made over and over, that if a node is not online it must not be a cluster member any more. That's not how things work, as explained in #432 (comment).

Copy link
Member

Choose a reason for hiding this comment

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

A quick experiment suggests that resetting a node makes it leave the cluster permanently. I'd still rename the function.

Copy link
Member

Choose a reason for hiding this comment

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

I prefer none of those. Sorry but isn't it obvious that the cluster here means an "rmq" cluster? This cookbook doesn't provision any other clusters AFAIK.

Copy link
Member

Choose a reason for hiding this comment

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

Any wrapper cookbooks probably won't manage other services either.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A wrapper cookbook would never manage rabbitmq and other services? I find this hard to believe as there are cookbooks like sensu that manage RMQ, redis, etc.

Would it help if we made it more like remove_self_from_rabbitmq_current_cluster ?

Copy link
Member

@michaelklishin michaelklishin Apr 19, 2017

Choose a reason for hiding this comment

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

Sensu and Logstash are pretty much the only ones that I can think of. Anyhow, this is not C and namespacing of functions is a solved problem. You can always invoke a function with a module name specified in case there are potential conflicts or ambiguity.

Copy link
Member

Choose a reason for hiding this comment

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

I'd accept reset_current_node or reset_this_node. rmq or rabbitmq are absolutely unnecessary and self is less specific than current_node.

@majormoses
Copy link
Contributor Author

@jjasghar looks like those failures are nothing to do with this PR

@majormoses majormoses force-pushed the feature/rmq-cluster-leave branch from 14faa34 to e98aa4b Compare April 19, 2017 20:59
@majormoses
Copy link
Contributor Author

@michaelklishin renamed function.

@michaelklishin
Copy link
Member

@jjasghar OK with you to merge?

@jjasghar
Copy link
Contributor

@majormoses can you rebase off master? We have a ton more testing now thanks to @rmoriz and would love to see how it shakes out.

@majormoses majormoses force-pushed the feature/rmq-cluster-leave branch from e98aa4b to b9ecff2 Compare April 28, 2017 06:46
This adds some helper functions to allow a wrapper cookbook to implement removing a node from a cluster in 2 scenarios:
- removing self from cluster (helpful for normal decommission)
- removing any node from cluster (helpful for abruptly terminated machines)

These both should not be actually consumed in this cookbook and simply be provided for wrappers to use as they see fit. This should be implemented only after careful thought, design, testing, etc.
@majormoses majormoses force-pushed the feature/rmq-cluster-leave branch from b9ecff2 to 4556fa9 Compare April 28, 2017 06:52
@majormoses
Copy link
Contributor Author

@jjasghar rebased

@jjasghar
Copy link
Contributor

Awesome!

@jjasghar jjasghar merged commit a160903 into rabbitmq:master Apr 28, 2017
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.

3 participants