voxpupuli/puppet-corosync

Colocation constraints with pcs provider are broken, incorrectly assume bidirectionality, swap order of primitives around

Closed this issue · 3 comments

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.

<rsc_colocation id="c_rbd_volume2_on_target1" rsc="g_target1" score="INFINITY" with-rsc="g_rbd_volume2"/>
<rsc_colocation id="c_rbd_volume1_on_target1" rsc="g_rbd_volume1" score="INFINITY" with-rsc="g_target1"/>

These two constraints are not identical, but were generated from equivalent cs_colocation resources.

Note that the author of the cs_primitive type realized that colocation constraints are directional:

    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 cs_colocation PCS provider author apparently disregarded that information.

@fghaas, @mkrakowitzer are you interested in providing your patches as pull request(s)?