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 1389453 - pcs operates incorrectly with "depth" attribute of resource operation
Summary: pcs operates incorrectly with "depth" attribute of resource operation
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: pcs
Version: 7.2
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: rc
: ---
Assignee: Ivan Devat
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
: 1473356 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-10-27 15:28 UTC by Ivan Devat
Modified: 2017-08-01 18:24 UTC (History)
7 users (show)

Fixed In Version: pcs-0.9.156-1.el7
Doc Type: Bug Fix
Doc Text:
Cause: The user runs "pcs resource create" with a resource agent, that contains an action with attribute depth != 0. Consequence: Pcs produces invalid cib and ends with an error message. Fix: Pcs transforms attribute "depth" into instance attribute "OCF_CHECK_LEVEL". Result: Pcs creates correctly the resource with a resource agent that contains an action with attribute depth != 0.
Clone Of:
Environment:
Last Closed: 2017-08-01 18:24:40 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
proposed fix (4.19 KB, patch)
2017-02-01 07:44 UTC, Ivan Devat
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:1958 0 normal SHIPPED_LIVE pcs bug fix and enhancement update 2017-08-01 18:09:47 UTC

Description Ivan Devat 2016-10-27 15:28:07 UTC
Description of problem:

Let us have a resource agent containing an action with the attribute "depth" != 0. Command "pcs resource create" produces invalid cib when such agent is used.

Steps to Reproduce:
> Prepare resource the agent containing an action with the attribute "depth" != 0.
  For example edit /usr/lib/ocf/resource.d/heartbeat/Dummy:
  Put line
    <action name="monitor"      timeout="20" interval="10" depth="0" />
  after line
    <action name="monitor"      timeout="20" interval="15" depth="10" />
  in metadata section.

> Try create resource with this agent
[vm-rhel72-1 ~] $ pcs resource create R ocf:heartbeat:Dummy


Actual results:
Error: Unable to update cib
Call cib_replace failed (-203): Update does not conform to the configured schema
<cib ...
      <primitive class="ocf" id="R" provider="heartbeat" type="Dummy">
        <instance_attributes id="R-instance_attributes"/>
        <operations>
          <op id="R-start-interval-0s" interval="0s" name="start" timeout="20"/>
          <op id="R-stop-interval-0s" interval="0s" name="stop" timeout="20"/>
          <op id="R-monitor-interval-10" interval="10" name="monitor" timeout="20"/>
          <op depth="10" id="R-monitor-interval-15" interval="15" name="monitor" timeout="20"/>
        </operations>
      </primitive>
...

Expected results:
Success with cib including something like this:
      <primitive class="ocf" id="R" provider="heartbeat" type="Dummy">
        <instance_attributes id="R-instance_attributes"/>
        <operations>
          <op id="R-start-interval-0s" interval="0s" name="start" timeout="20"/>
          <op id="R-stop-interval-0s" interval="0s" name="stop" timeout="20"/>
          <op id="R-monitor-interval-10" interval="10" name="monitor"/>
          <op id="R-monitor-interval-15" interval="15" name="monitor">
            <instance_attributes id="params-R-monitor-interval-15">
              <nvpair id="R-monitor-interval-15-OCF_CHECK_LEVEL-10" name="OCF_CHECK_LEVEL" value="10"/>
            </instance_attributes>
          </op>
        </operations>
      </primitive>

Additional info:
> Different behavior in current upstream version.
In the current upstream version this problem is partially corrected - pcs does not produce invalid cib. However the attribute "depth" is ommitted. So in cib there is:
...
      <primitive class="ocf" id="R" provider="heartbeat" type="Dummy">
        <instance_attributes id="R-instance_attributes"/>
        <operations>
          <op id="R-start-interval-0s" interval="0s" name="start" timeout="20"/>
          <op id="R-stop-interval-0s" interval="0s" name="stop" timeout="20"/>
          <op id="R-monitor-interval-10" interval="10" name="monitor" timeout="20"/>
          <op id="R-monitor-interval-15" interval="15" name="monitor" timeout="20"/>
        </operations>
      </primitive>
...

> There is not possible use attribute "depth" in "pcs resource create" command:
[vm-rhel72-1 ~] $ pcs resource create R ocf:heartbeat:Dummy op monitor depth=1
Error: depth is not a valid op option (use --force to override)
[vm-rhel72-1 ~] $ pcs resource create R ocf:heartbeat:Dummy op monitor depth=1 --force
Error: Unable to update cib
Call cib_replace failed (-203): Update does not conform to the configured schema
<cib...

Similar behavior is described in rhbz#1382597. However attribute "depth" should take an extra care. Its use should result to operation instance attribute OCF_CHECK_LEVEL (see above).

Comment 1 Tomas Jelinek 2016-10-27 15:30:39 UTC
If we allow the "depth" attribute to be used, we need to handle a situation where both "depth" and "OCF_CHECK_LEVEL" is specified.

Comment 3 Ivan Devat 2017-02-01 07:44:13 UTC
Created attachment 1246568 [details]
proposed fix

Test:
> attribute "depth" in the resource agent is transformed into "OCF_CHECK_LEVEL"
1) Put the attribute "depth" != 0 into a resource agent
  Edit /usr/lib/ocf/resource.d/heartbeat/Dummy:
  Put line
    <action name="monitor"      timeout="20" interval="15" depth="10" />
  after line
    <action name="monitor"      timeout="20" interval="10" depth="0" />
  in metadata section.

2) Try to create a resource with this agent
[vm-rhel72-1 ~] $ pcs resource create R ocf:heartbeat:Dummy
Warning: changing a monitor operation interval from 10 to 11 to make the operation unique
[vm-rhel72-1 ~] $ pcs cluster cib scope=resources | grep 'id="R"' -A11
  <primitive class="ocf" id="R" provider="heartbeat" type="Dummy">
    <operations>
      <op id="R-monitor-interval-10" interval="10" name="monitor" timeout="20"/>
      <op id="R-monitor-interval-11" interval="11" name="monitor" timeout="20">
        <instance_attributes id="R-monitor-interval-11-instance_attributes">
          <nvpair id="R-monitor-interval-11-instance_attributes-OCF_CHECK_LEVEL" name="OCF_CHECK_LEVEL" value="10"/>
        </instance_attributes>
      </op>
      <op id="R-start-interval-0s" interval="0s" name="start" timeout="20"/>
      <op id="R-stop-interval-0s" interval="0s" name="stop" timeout="20"/>
    </operations>
  </primitive>

> limited support of attribute "depth"
Attribute depth is not supported on the command line. For the backward compatibility we keep support for "OCF_CHECK_LEVEL" on the command line. The attribute "depth" could be confusing beside "OCF_CHECK_LEVEL".

Comment 4 Ivan Devat 2017-02-20 08:11:16 UTC
After Fix:

[vm-rhel72-1 ~] $ rpm -q pcs
pcs-0.9.156-1.el7.x86_64

[vm-rhel72-1 ~] $ cp /usr/lib/ocf/resource.d/heartbeat/Dummy /usr/lib/ocf/resource.d/heartbeat/Dummy.backup

[vm-rhel72-1 ~] $ sed -i 's/\(<action name="monitor".*\)$/\1\n<action name="monitor" timeout="20" interval="15" depth="10"\/>/' /usr/lib/ocf/resource.d/heartbeat/Dummy
[vm-rhel72-1 ~] $ cat /usr/lib/ocf/resource.d/heartbeat/Dummy | grep '<action name="monitor"'
<action name="monitor"      timeout="20" interval="10" depth="0" />
<action name="monitor" timeout="20" interval="15" depth="10"/>

[vm-rhel72-1 ~] $ pcs resource create R ocf:heartbeat:Dummy
[vm-rhel72-1 ~] $ pcs cluster cib|grep 'id="R-monitor-interval-15"' -A4
          <op id="R-monitor-interval-15" interval="15" name="monitor" timeout="20">
            <instance_attributes id="R-monitor-interval-15-instance_attributes">
              <nvpair id="R-monitor-interval-15-instance_attributes-OCF_CHECK_LEVEL" name="OCF_CHECK_LEVEL" value="10"/>
            </instance_attributes>
          </op>

[vm-rhel72-1 ~] $ mv /usr/lib/ocf/resource.d/heartbeat/Dummy.backup /usr/lib/ocf/resource.d/heartbeat/Dummy

Comment 8 Ivan Devat 2017-07-21 07:15:58 UTC
*** Bug 1473356 has been marked as a duplicate of this bug. ***

Comment 9 errata-xmlrpc 2017-08-01 18:24:40 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-2017:1958


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