RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1488044 - do not push the CIB as a diff if 'crm_feature_set' is <= 3.0.8
Summary: do not push the CIB as a diff if 'crm_feature_set' is <= 3.0.8
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: pcs
Version: 7.4
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: rc
: ---
Assignee: Tomas Jelinek
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-09-04 08:16 UTC by Ivan Devat
Modified: 2018-10-30 08:06 UTC (History)
9 users (show)

Fixed In Version: pcs-0.9.165-4.el7
Doc Type: Bug Fix
Doc Text:
Cause: There is a corner case in applying a diff update to the CIB when CIB's crm_feature_set < 3.0.9 so that that particular CIB update cannot be applied as a diff. Consequence: Pcs updates CIB using diffs. So if the user hits the corner case, it is not possible to do that particular change to CIB using pcs. Fix: Pcs switches to replacing the whole CIB instead of applying a diff for CIBs with crm_feature_set < 3.0.9. Result: It is possible to change such CIBs using pcs.
Clone Of:
Environment:
Last Closed: 2018-10-30 08:05:31 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
proposed fix + tests (105.14 KB, patch)
2018-01-12 11:09 UTC, Tomas Jelinek
no flags Details | Diff
fix for "pcs cluster cib-push" (9.10 KB, patch)
2018-08-13 15:31 UTC, Tomas Jelinek
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 851243 1 None None None 2021-01-20 06:05:38 UTC
Red Hat Bugzilla 1359057 0 medium CLOSED [cli] pcs should provide enhanced, stackable, integrity-protecting "pcs cluster cib/cib-push" alternative 2021-02-22 00:41:40 UTC
Red Hat Product Errata RHBA-2018:3066 0 None None None 2018-10-30 08:06:10 UTC

Internal Links: 851243 1359057

Description Ivan Devat 2017-09-04 08:16:07 UTC
Description of problem:
`crm_diff` applied on a large cib produces a diff that is not applicable via `cibadmin`.


Version-Release number of selected component (if applicable):
[vm-rhel72-1 ~] $ rpm -q pacemaker
pacemaker-1.1.16-12.el7.x86_64


Steps to Reproduce:
> get large cib
[vm-rhel72-1 ~] $ wget -O cib.large.original.xml https://raw.githubusercontent.com/ClusterLabs/pcs/master/pcs/test/resources/cib-large.xml
...
> copy new cib from the original large cib
[vm-rhel72-1 ~] $ cp cib.large.original.xml cib.large.new.xml

> add new resource
[vm-rhel72-1 ~] $ sed -i 's#</resources>#<primitive class="ocf" id="dummy0" provider="heartbeat" type="Dummy"><operations>\<op id="dummy0-monitor-interval-10" interval="10" name="monitor" timeout="20"/><op id="dummy0-start-interval-0s" interval="0s" name="start" timeout="20"/><op id="dummy0-stop-interval-0s" interval="0s" name="stop" timeout="20"/></operations></primitive></resources>#' cib.large.new.xml


Actual results:

> now `crm_diff` produces diff (it replaces whole cib with a cib with only one resource?)...
[vm-rhel72-1 ~] $ crm_diff --original cib.large.original.xml --new cib.large.new.xml --no-version
<diff crm_feature_set="3.0.12" format="1" digest="07115fe175a2e2301ce65b9796ccd9c5">
  <diff-removed>
    <cib/>
  </diff-removed>
  <diff-added>
    <cib cib-last-written="Thu Aug 23 16:49:17 2012" crm_feature_set="3.0.6" dc-uuid="2" have-quorum="0" update-client="crmd" update-origin="rh7-3" validate-with="pacemaker-1.2">
      <configuration>
        <resources>
          <primitive class="ocf" id="dummy0" provider="heartbeat" type="Dummy" __crm_diff_marker__="added:top">
            <operations>
              <op id="dummy0-monitor-interval-10" interval="10" name="monitor" timeout="20"/>
              <op id="dummy0-start-interval-0s" interval="0s" name="start" timeout="20"/>
              <op id="dummy0-stop-interval-0s" interval="0s" name="stop" timeout="20"/>
            </operations>
          </primitive>
        </resources>
      </configuration>
    </cib>
  </diff-added>
</diff>


> ...and the diff cannot be applied to the original cib
[vm-rhel72-1 ~] $ cp cib.large.original.xml cib.large.live.xml
[vm-rhel72-1 ~] $ crm_diff --original cib.large.original.xml --new cib.large.new.xml --no-version | CIB_file=cib.large.live.xml cibadmin --patch --verbose --xml-pipe
Call failed: Application of an update diff failed


Expected results:
`crm_diff` produces correct cib which can be applied with `cibadmin`.


Additional info:

When I tried to lint the cib.large.new.xml against .rng I got an rng error:
[vm-rhel72-1 ~] $ jing /usr/share/pacemaker/pacemaker-2.8.rng cib.large.new.xml
/usr/share/pacemaker/status-1.0.rng:15:18: error: conflicting ID-types for attribute "id" of element "port-mapping"

Comment 2 Ivan Devat 2017-09-04 11:52:56 UTC
After some additional research we discovered that it is not important that the cib is large. The value of attribute "crm_feature_set" of the element "cib" is what matters .

> with crm_feature_set="3.0.8"
[vm-rhel72-1 ~] $ cat cib.short.original.xml
<cib epoch="576" num_updates="0" admin_epoch="0" validate-with="pacemaker-2.0" crm_feature_set="3.0.8" update-origin="rh7-3" update-client="crmd" cib-last-written="Thu Aug 23 16:49:17 2012" have-quorum="0" dc-uuid="2">
  <configuration>
    <crm_config/>
    <nodes/>
    <resources>
      <group id="MyGroup">
        <primitive class="ocf" id="A2" provider="heartbeat" type="Dummy">
          <operations>
            <op id="A2-monitor-interval-10" interval="10" name="monitor" timeout="20"/>
          </operations>
        </primitive>
      </group>
    </resources>
    <constraints/>
  </configuration>
  <status/>
</cib>

[vm-rhel72-1 ~] $ cp cib.short.original.xml cib.short.new.xml
[vm-rhel72-1 ~] $ sed -i 's#<group id="MyGroup">#<group id="MyGroup"><primitive class="ocf" id="A8" provider="heartbeat" type="Dummy"><operations><op id="A8-monitor-interval-10" interval="10" name="monitor" timeout="20"/></operations></primitive>#' cib.short.new.xml

[vm-rhel72-1 ~] $ crm_diff --original cib.short.original.xml --new cib.short.new.xml --no-version
<diff crm_feature_set="3.0.12" format="1" digest="303628457fcbe83eff1b2b11dbdd2a41">
  <diff-removed>
    <cib/>
  </diff-removed>
  <diff-added>
    <cib validate-with="pacemaker-2.0" crm_feature_set="3.0.8" update-origin="rh7-3" update-client="crmd" cib-last-written="Thu Aug 23 16:49:17 2012" have-quorum="0" dc-uuid="2">
      <configuration>
        <resources>
          <group id="MyGroup">
            <primitive class="ocf" id="A8" provider="heartbeat" type="Dummy" __crm_diff_marker__="added:top">
              <operations>
                <op id="A8-monitor-interval-10" interval="10" name="monitor" timeout="20"/>
              </operations>
            </primitive>
          </group>
        </resources>
      </configuration>
    </cib>
  </diff-added>
</diff>

[vm-rhel72-1 ~] $ cp cib.short.original.xml cib.short.live.xml
[vm-rhel72-1 ~] $ crm_diff --original cib.short.original.xml --new cib.short.new.xml --no-version | CIB_file=cib.short.live.xml cibadmin --patch --verbose --xml-pipe
Call failed: Application of an update diff failed


> with crm_feature_set="3.0.12"
[vm-rhel72-1 ~] $ sed -i 's#3\.0\.8#3.0.12#' cib.short.original.xml
[vm-rhel72-1 ~] $ sed -i 's#3\.0\.8#3.0.12#' cib.short.new.xml
[vm-rhel72-1 ~] $ crm_diff --original cib.short.original.xml --new cib.short.new.xml --no-version
<diff format="2">
  <change operation="create" path="/cib/configuration/resources/group[@id=&apos;MyGroup&apos;]" position="0">
    <primitive class="ocf" id="A8" provider="heartbeat" type="Dummy">
      <operations>
        <op id="A8-monitor-interval-10" interval="10" name="monitor" timeout="20"/>
      </operations>
    </primitive>
  </change>
</diff>

[vm-rhel72-1 ~] $ cp cib.short.original.xml cib.short.live.xml
[vm-rhel72-1 ~] $ crm_diff --original cib.short.original.xml --new cib.short.new.xml --no-version | CIB_file=cib.short.live.xml cibadmin --patch --verbose --xml-pipe
[vm-rhel72-1 ~] $ echo $?
0

Comment 4 Ken Gaillot 2017-10-19 20:42:02 UTC
This turned out to be an ancient known bug that was fixed long ago, but the old behavior is preserved for compatibility. Hence it only affects CIBs with crm_feature_set less than or equal to 3.0.8.

There are two patch formats used by pacemaker, "v1" (<=3.0.8) and "v2" (>3.0.8, which should be anything created in RHEL 7.1 and later). The v1 format has a bug where it can't handle adding the first child of an element -- in this case, adding the resource as the first member of the group is what makes it fail.

I see two options:

* pcs could automatically call "cibadmin --upgrade" for anything with crm_feature_set <=3.0.8, before applying any changes. This is probably the best option.

* We could add a "force v2" option to crm_diff, that pcs can use. I'd like this to become the default behavior in upstream Pacemaker 2.0, which is likely to make it into RHEL 7 at some point. So the option would be a temporary measure. But if you want to avoid upgrading the CIB, we could go this route.

Let me know which you'd prefer.

Comment 5 Ken Gaillot 2017-10-19 20:48:49 UTC
(In reply to Ken Gaillot from comment #4)
> * We could add a "force v2" option to crm_diff, that pcs can use. I'd like
> this to become the default behavior in upstream Pacemaker 2.0, which is
> likely to make it into RHEL 7 at some point. So the option would be a
> temporary measure. But if you want to avoid upgrading the CIB, we could go
> this route.

A better way to do the above would be a downstream patch to make crm_diff always use v2 in RHEL, which wouldn't need any changes in pcs. Once upstream adopted the behavior, the patch would go away.

I still think anyone with a config that old would benefit from a cibadmin --upgrade, so they can use current features, but again, let me know which you prefer.

Comment 6 Ivan Devat 2017-10-20 10:43:58 UTC
It seems that pacemaker itself upgrade the crm_feature_set:

[vm-rhel72-1 ~] $ cat /var/lib/pacemaker/cib/cib.xml | grep crm_feature_set
<cib crm_feature_set="3.0.12" validate-with="pacemaker-2.8" epoch="21" num_updates="0" admin_epoch="0" cib-last-written="Fri Oct 20 09:25:11 2017" update-origin="vm-rhel72-1" update-client="cibadmin" update-user="root" have-quorum="1">

[vm-rhel72-1 ~] $ pcs cluster stop --all
vm-rhel72-1: Stopping Cluster (pacemaker)...
vm-rhel72-3: Stopping Cluster (pacemaker)...
vm-rhel72-1: Stopping Cluster (corosync)...
vm-rhel72-3: Stopping Cluster (corosync)...

[vm-rhel72-1 ~] $ sed -i 's/crm_feature_set="3.0.12"/crm_feature_set="3.0.8"/' /var/lib/pacemaker/cib/cib.xml
[vm-rhel72-1 ~] $ rm /var/lib/pacemaker/cib/cib.xml.sig
[vm-rhel72-1 ~] $ ssh vm-rhel72-3 'sed -i "s/crm_feature_set=\"3.0.12\"/crm_feature_set=\"3.0.8\"/" /var/lib/pacemaker/cib/cib.xml'
[vm-rhel72-1 ~] $ ssh vm-rhel72-3 'rm /var/lib/pacemaker/cib/cib.xml.sig'

[vm-rhel72-1 ~] $ pcs cluster start --all
vm-rhel72-1: Starting Cluster...
vm-rhel72-3: Starting Cluster...

[vm-rhel72-1 ~] $ cat /var/lib/pacemaker/cib/cib.xml | grep crm_feature_set
<cib crm_feature_set="3.0.12" validate-with="pacemaker-2.8" epoch="21" num_updates="0" admin_epoch="0" cib-last-written="Fri Oct 20 09:59:20 2017" update-origin="vm-rhel72-1" update-client="cibadmin" update-user="root" have-quorum="1">

> "force v2"
If pacemaker always upgrade crm_feature_set (is it so?) the problem should not appear with a new pacemaker. So "force v2" is not required in this case. If pcs meet an older version of pacemaker then it is without "force v2".

> upgrade in pcs
The workflow with CIB is: load (upgrade reload)? edit push. It is possible that the version of crm_feature_set is still unsufficient after the upgrade. So in the push must deal with an old crm_feature_set anyway. So the upgrade does not solve problem.

> There is an another option:
Pcs can check crm_feature_set during the push and it can push CIB without the crm_diff (i.e. full replacement + warning) if crm_feature_set is not sufficient.

This option should be enough:
1) New pcs should not meet an old pacemaker in RHEL. So the live CIB will be pushed always via diff in new RHEL.
2) When the pcs meet an old pacemaker then the live CIB will be fully replaced as before (see bug 1441673).
3) If there is CIB_file with an old crm_feature_set then the full replacement will be applied. The reasons for pushing via diff are described in bug 1441673: 1) concurrent editing  2) acl issue 3) performance. These should be no real problem in the case of CIB_file.

So does pacemaker always upgrade the crm_feature_set? If so then this bz could be reassigned to pcs.

Comment 7 Ken Gaillot 2017-10-20 15:15:26 UTC
> There is an another option:
> Pcs can check crm_feature_set during the push and it can push CIB without the
> crm_diff (i.e. full replacement + warning) if crm_feature_set is not
> sufficient.

Ah, I didn't think of that. That would be fine, too.

> So does pacemaker always upgrade the crm_feature_set?

No, pacemaker never does it automatically, only if someone/something calls cibadmin --upgrade.

Your test in Comment 6 didn't remove all previous CIBs (*.raw *.sig), so most likely, pacemaker used one of them instead of the unsigned cib.xml.

pcs does automatically call cibadmin --upgrade if the user uses a newer feature that their current feature set doesn't support. The "upgrade in pcs" suggestion is to do that unconditionally if the feature set is <= 3.0.8 (which should only be configurations created in 7.0 that have never been upgraded). But if we want to avoid unnecessary upgrades at all cost, we could instead do Comment 5 (the "force v2" option) or the full replacement.

> The workflow with CIB is: load (upgrade reload)? edit push. It is possible that
> the version of crm_feature_set is still unsufficient after the upgrade. So in
> the push must deal with an old crm_feature_set anyway. So the upgrade does not
> solve problem.

cibadmin --upgrade always upgrades to the most recent schema possible. It should be extremely rare that there any failures in that process.

Comment 8 Ken Gaillot 2017-10-20 21:31:23 UTC
Whoops, I confused crm_feature_set and the XML schema version. cibadmin --upgrade won't help at all here. crm_feature_set is set automatically based on the version of the node that's currently DC. So, we should only ever see crm_feature_set on a mixed-version cluster in a rolling upgrade from 7.0 to the current version, or in a CIB_file -- probably not a significant concern in practice.

Our options are to do a full replace when crm_feature_set <= 3.0.8, and/or to always force v2 patches downstream.

Comment 9 Ivan Devat 2017-10-23 08:45:13 UTC
(In reply to Ken Gaillot from comment #8)
> Whoops, I confused crm_feature_set and the XML schema version. cibadmin
> --upgrade won't help at all here. crm_feature_set is set automatically based
> on the version of the node that's currently DC. So, we should only ever see
> crm_feature_set on a mixed-version cluster in a rolling upgrade from 7.0 to
> the current version, or in a CIB_file -- probably not a significant concern
> in practice.
> 
> Our options are to do a full replace when crm_feature_set <= 3.0.8, and/or
> to always force v2 patches downstream.

If I understand well:
The crm_feature_set could be <= 3.0.8 in the case that one node have an old pacemaker and this node is DC. 
Pushing the CIB via diff can fail in such cluster.

1) If pcs make full replacement of CIB in case of crm_feature_set <= 3.0.8 it will succeed. But the concurrency issue appears here.

2) If cibadmin adds "force v2" option then pushing CIB via diff succeeds on node with new pacemaker. But the full replacement is performed on a node with an old pacemaker (since an old cibadmin is without "force v2"; not mentioned that there is installed an old pcs version most probably). So the concurrency issue is solved only partialy.

I think that pcs should decide push mechanism according to crm_feature_set. I think it is not absolutely necessary to add "force v2" to cibadmin.

Comment 10 Ken Gaillot 2017-10-23 14:15:06 UTC
(In reply to Ivan Devat from comment #9)
> If I understand well:
> The crm_feature_set could be <= 3.0.8 in the case that one node have an old
> pacemaker and this node is DC. 
> Pushing the CIB via diff can fail in such cluster.

Correct. FYI, the oldest node will always be selected as the DC -- that ensures that all nodes support the features it uses.

> 1) If pcs make full replacement of CIB in case of crm_feature_set <= 3.0.8
> it will succeed. But the concurrency issue appears here.
> 
> 2) If cibadmin adds "force v2" option then pushing CIB via diff succeeds on
> node with new pacemaker. But the full replacement is performed on a node
> with an old pacemaker (since an old cibadmin is without "force v2"; not
> mentioned that there is installed an old pcs version most probably). So the
> concurrency issue is solved only partialy.
> 
> I think that pcs should decide push mechanism according to crm_feature_set.
> I think it is not absolutely necessary to add "force v2" to cibadmin.

Yes, that sounds good. Re-assigning to pcs.

Comment 11 Tomas Jelinek 2018-01-12 11:09:59 UTC
Created attachment 1380384 [details]
proposed fix + tests

Comment 12 Tomas Jelinek 2018-01-12 11:26:17 UTC
Test:

This can only be tested using pcs commands overhauled to the new pcs architecture. Commands not yet overhauled always replace the hole CIB and never do a diff. 

1. Use a CIB with crm_feature_set > 3.0.8. Run a pcs command, e.g. "pcs resource manage" with --debug and verify the CIB is pushed as a diff.
2. Use a CIB with crm_feature_set <= 3.0.8. Run a pcs command, e.g. "pcs resource manage" with --debug and verify the CIB is replaced as a whole and a warning is displayed proposing pacemaker update due to this.

Additional details leading to a more real-world like test scenario are described in comment 4.

Comment 15 Ivan Devat 2018-06-26 06:53:53 UTC
After Fix:

[ant ~] $ rpm -q pcs pcs-snmp
pcs-0.9.165-1.el7.x86_64
pcs-snmp-0.9.165-1.el7.x86_64

>  with `crm_feature_set` >= 3.0.8: cibadmin is used only for loading cib and for pushing cib `crm_diff` is used

[ant ~] $ pcs cluster cib /tmp/cib.xml
[ant ~] $ cat /tmp/cib.xml|grep -m1 crm_feature_set
<cib crm_feature_set="3.0.12" validate-with="pacemaker-2.8" epoch="7" num_updates="5" admin_epoch="0" cib-last-written="Mon Jun 25 10:06:39 2018" update-origin="ant" update-client="cibadmin" update-user="root" have-quorum="1" dc-uuid="2">

[ant ~] $ pcs resource -f /tmp/cib.xml manage R1 --debug | grep "/usr/sbin/cibadmin\|crm_diff"
Running: /usr/sbin/cibadmin --local --query
Finished running: /usr/sbin/cibadmin --local --query
Running: /usr/sbin/crm_diff --original /tmp/tmpJQuNyA.pcs --new /tmp/tmpSyOMqj.pcs --no-version
Finished running: /usr/sbin/crm_diff --original /tmp/tmpJQuNyA.pcs --new /tmp/tmpSyOMqj.pcs --no-version

>  with `crm_feature_set` < 3.0.8: cibadmin is used for both - loading and pushing cib

[ant ~] $ sed -i 's#crm_feature_set="3.0.12"#crm_feature_set="3.0.7"#' /tmp/cib.xml
[ant ~] $ cat /tmp/cib.xml|grep -m1 crm_feature_set
<cib crm_feature_set="3.0.7" validate-with="pacemaker-2.8" epoch="7" num_updates="5" admin_epoch="0" cib-last-written="Mon Jun 25 10:06:39 2018" update-origin="ant" update-client="cibadmin" update-user="root" have-quorum="1" dc-uuid="2">

[ant ~] $ pcs resource -f /tmp/cib.xml manage R1 --debug | grep "/usr/sbin/cibadmin\|crm_diff"
Running: /usr/sbin/cibadmin --local --query
Finished running: /usr/sbin/cibadmin --local --query
Running: /usr/sbin/cibadmin --replace --verbose --xml-pipe --scope configuration
Finished running: /usr/sbin/cibadmin --replace --verbose --xml-pipe --scope configuration

Comment 17 Jan Pokorný [poki] 2018-08-06 16:24:45 UTC
Does pcs properly guard against

  pcs cluster cib-push new.xml diff-against=original.xml

when the operation would possibly fail because current crm_feature_set
is not sufficiently recent enough?

If not, it definitely should (i.e., full surface of this bug would
preferably get cleared).

There might even be an optimizing heuristic per the buggy behaviour
detailed above:

  push the complete version instead
  iff
  (
    patch adds first child of an element
    AND
    subsequently queried current crm_feature_set <= 3.0.8
  )

and otherwise, just send the delta.

Alternatively, fail in the non-straightforward cases
(yet allow --force?), suggesting full-fledged

  pcs cluster cib-push <new.xml> --config

* * *

Speaking of "queried crm_feature_set", it looks like the current
implemenation doesn't check what version is used within cluster
right now, which is bad when one takes new.xml and original.xml
from a completely different, possibly newer cluster.
(That's another fragility that could be prevented with the
suggested "integrity pipelines scheme" per [bug 1359057]).

Comment 19 Ivan Devat 2018-08-07 09:12:33 UTC
(In reply to Jan Pokorný from comment #17)
> Does pcs properly guard against
> 
>   pcs cluster cib-push new.xml diff-against=original.xml
> 
> when the operation would possibly fail because current crm_feature_set
> is not sufficiently recent enough?

No, it does not. Here is a reproducer:

[ant ~] $ pcs cluster cib /tmp/cib.original.xml
[ant ~] $ cp /tmp/cib.original.xml /tmp/cib.new.xml
[ant ~] $ pcs resource -f /tmp/cib.new.xml create R1 ocf:heartbeat:Dummy
[ant ~] $ sed -i 's#crm_feature_set="3.0.14"#crm_feature_set="3.0.7"#' /tmp/cib.original.xml
[ant ~] $ pcs cluster cib-push /tmp/cib.new.xml diff-against=/tmp/cib.original.xml
Error: unable to push cib
Call cib_apply_diff failed (-206): Application of an update diff failed

Thank you for pointing out.

> 
> If not, it definitely should (i.e., full surface of this bug would
> preferably get cleared).
> 
> There might even be an optimizing heuristic per the buggy behaviour
> detailed above:
> 
>   push the complete version instead
>   iff
>   (
>     patch adds first child of an element
>     AND
>     subsequently queried current crm_feature_set <= 3.0.8
>   )
> 
> and otherwise, just send the delta.

The `diff-against` option was introduced in context of bug 1404233. So I'm not sure if pushing complete version is the right way.

Comment 20 Tomas Jelinek 2018-08-13 15:31:21 UTC
Created attachment 1475608 [details]
fix for "pcs cluster cib-push"

Comment 21 Tomas Jelinek 2018-08-13 15:33:59 UTC
Test for the patch from comment 20 is in comment 19, expected results after fix:
# pcs cluster cib-push bbb.xml diff-against=aaa.xml
Error: unable to diff against original cib 'aaa.xml': the 'crm_feature_set' version is '3.0.1' but at least version '3.0.9' is required

Comment 22 Ondrej Mular 2018-08-16 09:51:40 UTC
After fix
[root@rhel76-node1 ~]# rpm -q pcs
pcs-0.9.165-4.el7.x86_64

[root@rhel76-node1 ~]# pcs cluster cib cib.orig.xml
[root@rhel76-node1 ~]# cp cib.orig.xml cib.new.xml
[root@rhel76-node1 ~]# pcs resource -f cib.new.xml create R1 ocf:heartbeat:Dummy
[root@rhel76-node1 ~]# sed -i 's#crm_feature_set="3.0.14"#crm_feature_set="3.0.7"#' cib.orig.xml
[root@rhel76-node1 ~]# pcs cluster cib-push cib.new.xml diff-against=cib.orig.xml
Error: unable to diff against original cib 'cib.orig.xml': the 'crm_feature_set' version is '3.0.7' but at least version '3.0.9' is required

Comment 26 errata-xmlrpc 2018-10-30 08:05:31 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:3066


Note You need to log in before you can comment on or make changes to this bug.