-
Notifications
You must be signed in to change notification settings - Fork 38
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
[UNTESTED] prevent clusters with an even number of nodes #18
base: master
Are you sure you want to change the base?
Conversation
if members.length % 2 == 0 && members.length > 2 | ||
validation_error \ | ||
"Clusters must have an odd number of nodes to ensure quorum during " \ | ||
"partitioning. 2-node clusters are allowed as a special exception." |
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.
You're old-school. We don't use two spaces at the end of a sentence anymore ;-)
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.
Who's "we"? I use it all the time :-p And it has the significant advantage of allowing my editor to jump forward/backward by one sentence at a time.
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.
We should use i18n here. ;)
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.
We should use i18n here. ;)
👍 that's how it should be done for all new code parts.
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.
Now uses i18n. I think I originally submitted this before we used i18n :-)
Anyway, +1 for the code. |
+1 for me, but maybe this needs to be checked also in the UI part (javascript)? |
2961378
to
e2fa5cd
Compare
@@ -510,6 +510,12 @@ def validate_proposal_after_save proposal | |||
elements = proposal["deployment"]["pacemaker"]["elements"] | |||
members = elements["pacemaker-cluster-member"] || [] | |||
|
|||
if members.length % 2 == 0 && members.length > 2 |
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.
Style/EvenOdd: Replace with Fixnum#even?
. (https://github.com/bbatsov/ruby-style-guide#predicate-methods)
Clusters must have an odd number of nodes to ensure quorum during partitioning. 2-node clusters are allowed as a special exception for the typical DRBD setup.
e2fa5cd
to
ccfcaf0
Compare
Updated, but still haven't tested. Any volunteers? ;-) |
Clusters must have an odd number of nodes to ensure quorum during partitioning. 2-node clusters are allowed as a special exception for the typical DRBD setup.