-
-
Notifications
You must be signed in to change notification settings - Fork 161
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
Colocation constraints with pcs provider are broken, incorrectly assume bidirectionality, swap order of primitives around #150
Comments
fghaas
changed the title
Colocation constraints are broken, incorrectly assume bidirectionality, swap order of primitives around
Colocation constraints with pcs provider are broken, incorrectly assume bidirectionality, swap order of primitives around
Jul 14, 2015
fghaas
added a commit
to fghaas/puppet-corosync
that referenced
this issue
Jul 14, 2015
fghaas
added a commit
to fghaas/puppet-corosync
that referenced
this issue
Jul 14, 2015
fghaas
added a commit
to fghaas/puppet-corosync
that referenced
this issue
Jul 14, 2015
cs_colocation, when used with the pcs provider, makes the incorrect assumption that the order of primitives in colocation constraints is arbitrary. It is not, and the following must not be equivalent: cs_colocation { 'vip_with_service': primitives => [ 'nginx_vip', 'nginx_service' ], } cs_colocation { 'vip_with_service': primitives => [ 'nginx_service', 'nginx_vip' ], } These mean different things. The first example ensures that nginx_vip runs on whatever node nginx_service runs on, and if nginx_service can't be started on any node, Pacemaker won't even attempt to start nginx_vip. However, if nginx_vip cannot be started on any node, nginx_service will continue to be available. The second example means the opposite. In it, nginx_service is configured to run wherever nginx_vip runs, and if nginx_vip can't run anywhere, nginx_service won't start. And if nginx_vip cannot be started on any node, nginx_service will not be available. As a result, drop artificial sorting for the primitives, and use them exactly as specified. Fixes issue voxpupuli#150.
fghaas
added a commit
to fghaas/puppet-iscsi-rbd-ha
that referenced
this issue
Jul 14, 2015
fghaas
added a commit
to fghaas/puppet-iscsi-rbd-ha
that referenced
this issue
Jul 15, 2015
fghaas
added a commit
to fghaas/puppet-iscsi-rbd-ha
that referenced
this issue
Jul 15, 2015
Note that the author of the newproperty(:primitives, :array_matching => :all) do
desc "At least two Pacemaker primitives to be located together. Order of primitives
in colocation groups is important. In Pacemaker, a colocation of 2 primitives
behaves different than a colocation between more than 2 primitives. Here the
behavior is altered to be more consistent. The |
fghaas
added a commit
to fghaas/puppet-corosync
that referenced
this issue
Jul 20, 2015
cs_colocation, when used with the pcs provider, makes the incorrect assumption that the order of primitives in colocation constraints is arbitrary. It is not, and the following must not be equivalent: cs_colocation { 'vip_with_service': primitives => [ 'nginx_service', 'nginx_vip' ], } cs_colocation { 'vip_with_service': primitives => [ 'nginx_vip', 'nginx_service' ], } These mean different things. The first example ensures that nginx_vip runs on whatever node nginx_service runs on, and if nginx_service can't be started on any node, Pacemaker won't even attempt to start nginx_vip. However, if nginx_vip cannot be started on any node, nginx_service will continue to be available. The second example means the opposite. In it, nginx_service is configured to run wherever nginx_vip runs, and if nginx_vip can't run anywhere, nginx_service won't start. But if nginx_service cannot be started, nginx_vip is still available. Note that the provider's expected order is directly reversed compared to the one that standalone Pacemaker would use (no matter whether pcs or crm is used). At any rate, for the pcs provider the order of resources is wrong, and injecting the sort to mask that issue is nonsense. As a result, drop artificial sorting for the primitives, fix the order, and use them exactly as specified. Fixes issue voxpupuli#150.
fghaas
added a commit
to fghaas/puppet-corosync
that referenced
this issue
Jul 20, 2015
cs_colocation, when used with the pcs provider, makes the incorrect assumption that the order of primitives in colocation constraints is arbitrary. It is not, and the following must not be equivalent: cs_colocation { 'vip_with_service': primitives => [ 'nginx_service', 'nginx_vip' ], } cs_colocation { 'vip_with_service': primitives => [ 'nginx_vip', 'nginx_service' ], } These mean different things. The first example ensures that nginx_vip runs on whatever node nginx_service runs on, and if nginx_service can't be started on any node, Pacemaker won't even attempt to start nginx_vip. However, if nginx_vip cannot be started on any node, nginx_service will continue to be available. The second example means the opposite. In it, nginx_service is configured to run wherever nginx_vip runs, and if nginx_vip can't run anywhere, nginx_service won't start. But if nginx_service cannot be started, nginx_vip is still available. Note that the provider's expected order is directly reversed compared to the one that standalone Pacemaker would use (no matter whether pcs or crm is used). This is intentional as per commit 8e218d9. At any rate, for the pcs provider the order of resources is wrong, and injecting the sort to mask that issue is nonsense. As a result, drop artificial sorting for the primitives, fix the order, and use them exactly as specified. Fixes issue voxpupuli#150.
@fghaas, @mkrakowitzer are you interested in providing your patches as pull request(s)? |
fghaas
added a commit
to fghaas/puppet-corosync
that referenced
this issue
Nov 2, 2015
cs_colocation, when used with the pcs provider, makes the incorrect assumption that the order of primitives in colocation constraints is arbitrary. It is not, and the following must not be equivalent: cs_colocation { 'vip_with_service': primitives => [ 'nginx_service', 'nginx_vip' ], } cs_colocation { 'vip_with_service': primitives => [ 'nginx_vip', 'nginx_service' ], } These mean different things. The first example ensures that nginx_vip runs on whatever node nginx_service runs on, and if nginx_service can't be started on any node, Pacemaker won't even attempt to start nginx_vip. However, if nginx_vip cannot be started on any node, nginx_service will continue to be available. The second example means the opposite. In it, nginx_service is configured to run wherever nginx_vip runs, and if nginx_vip can't run anywhere, nginx_service won't start. But if nginx_service cannot be started, nginx_vip is still available. Note that the provider's expected order is directly reversed compared to the one that standalone Pacemaker would use (no matter whether pcs or crm is used). This is intentional as per commit 8e218d9. At any rate, for the pcs provider the order of resources is wrong, and injecting the sort to mask that issue is nonsense. As a result, drop artificial sorting for the primitives, fix the order, and use them exactly as specified. Fixes issue voxpupuli#150.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://github.com/puppet-community/puppet-corosync/blob/master/lib/puppet/provider/cs_colocation/pcs.rb#L39 says that the order of primitives in colocation constraints does not matter. It does.
These two constraints are not identical, but were generated from equivalent
cs_colocation
resources.The text was updated successfully, but these errors were encountered: