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 1867516 - Resource and operation defaults with mixed and-or rules cause an invalid CIB error
Summary: Resource and operation defaults with mixed and-or rules cause an invalid CIB ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: pcs
Version: 8.3
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: rc
: 8.3
Assignee: Tomas Jelinek
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-08-10 08:48 UTC by Tomas Jelinek
Modified: 2020-11-04 02:29 UTC (History)
9 users (show)

Fixed In Version: pcs-0.10.6-4.el8
Doc Type: Bug Fix
Doc Text:
Cause: Both 'and' and 'or' operators are used in a rule when creating a new resource or operation defaults set. Consequence: Pcs exits with a 'Unable to update cib' error and the defaults set is not created. Fix: Make sure pcs creates a valid CIB in case both 'and' and 'or' operators are used in a rule. Result: No error, the defaults set is successfully created.
Clone Of:
Environment:
Last Closed: 2020-11-04 02:28:18 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
proposed fix + tests (4.58 KB, patch)
2020-08-11 07:52 UTC, Tomas Jelinek
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1817547 1 None None None 2023-06-14 11:02:39 UTC
Red Hat Knowledge Base (Solution) 5320121 0 None None None 2020-08-14 22:36:37 UTC
Red Hat Product Errata RHEA-2020:4617 0 None None None 2020-11-04 02:28:54 UTC

Description Tomas Jelinek 2020-08-10 08:48:58 UTC
Description of problem:
When both 'and' and 'or' operators are used in a rule, pcs creates a CIB improperly causing pacemaker to reject it.


Version-Release number of selected component (if applicable):
pcs-0.10.6-3.el8.


How reproducible:
always, easily


Steps to Reproduce:
pcs resource op defaults set create rule 'resource ::Dummy and (op start or op stop)'


Actual results:
Error: Unable to update cib
Call cib_apply_diff failed (-203): Update does not conform to the configured schema


Expected results:
No error, default set created with the rule.

Comment 3 Tomas Jelinek 2020-08-11 07:52:13 UTC
Created attachment 1711043 [details]
proposed fix + tests

Comment 4 Miroslav Lisik 2020-08-12 09:08:26 UTC
Test:

[root@r8-node-01 rpms]# rpm -q pcs
pcs-0.10.6-4.el8.x86_64

[root@r8-node-01 rpms]# pcs resource op defaults set create rule 'resource ::Dummy and (op start or op stop)'
Warning: Defaults do not apply to resources which override them with their own defined values
[root@r8-node-01 rpms]# echo $?
0
[root@r8-node-01 rpms]# pcs resource op defaults
Meta Attrs: op_defaults-meta_attributes
  Rule: boolean-op=and score=INFINITY
    Expression: resource ::Dummy
    Rule: boolean-op=or score=0
      Expression: op start
      Expression: op stop

Comment 7 Michal Mazourek 2020-08-13 11:29:59 UTC
BEFORE:
=======

[root@virt-125 ~]# rpm -q pcs
pcs-0.10.6-3.el8.x86_64


[root@virt-125 ~]# pcs resource op defaults set create rule 'resource ::Dummy and (op start or op stop)'
Warning: Defaults do not apply to resources which override them with their own defined values
Error: Unable to update cib
Call cib_apply_diff failed (-203): Update does not conform to the configured schema
{cib output}

[root@virt-125 ~]# echo $?
1


AFTER:
======

[root@virt-500 ~]# rpm -q pcs
pcs-0.10.6-4.el8.x86_64


[root@virt-500 ~]# pcs resource op defaults set create rule 'resource ::Dummy and (op start or op stop)'
Warning: Defaults do not apply to resources which override them with their own defined values
[root@virt-500 ~]# echo $?
0
[root@virt-500 ~]# pcs resource op defaults
Meta Attrs: op_defaults-meta_attributes
  Rule: boolean-op=and score=INFINITY
    Expression: resource ::Dummy
    Rule: boolean-op=or score=0
      Expression: op start
      Expression: op stop


[root@virt-500 ~]# pcs resource op defaults set create rule 'resource ::Dummy and (op start and op stop)'
Warning: Defaults do not apply to resources which override them with their own defined values
[root@virt-500 ~]# echo $?
0
[root@virt-500 ~]# pcs resource op defaults
Meta Attrs: op_defaults-meta_attributes
  Rule: boolean-op=and score=INFINITY
    Expression: resource ::Dummy
    Rule: boolean-op=or score=0
      Expression: op start
      Expression: op stop
Meta Attrs: op_defaults-meta_attributes-1
  Rule: boolean-op=and score=INFINITY
    Expression: resource ::Dummy
    Rule: boolean-op=and score=0
      Expression: op start
      Expression: op stop

> OK


[root@virt-500 ~]# pcs resource op defaults set remove op_defaults-meta_attributes op_defaults-meta_attributes-1


[root@virt-500 ~]# pcs resource op defaults set create rule 'resource ::Dummy and resource ::apache and (op start and op stop)'
Warning: Defaults do not apply to resources which override them with their own defined values
[root@virt-500 ~]# echo $?
0
[root@virt-500 ~]# pcs resource op defaults
Meta Attrs: op_defaults-meta_attributes
  Rule: boolean-op=and score=INFINITY
    Expression: resource ::Dummy
    Expression: resource ::apache
    Rule: boolean-op=and score=0
      Expression: op start
      Expression: op stop

[root@virt-500 ~]# pcs resource op defaults set create meta m=v rule 'resource ::Stateful and (op start or op stop or op promote)'
Warning: Defaults do not apply to resources which override them with their own defined values
[root@virt-500 ~]# echo $?
0
[root@virt-500 ~]# pcs resource op defaults
Meta Attrs: op_defaults-meta_attributes
  Rule: boolean-op=and score=INFINITY
    Expression: resource ::Dummy
    Expression: resource ::apache
    Rule: boolean-op=and score=0
      Expression: op start
      Expression: op stop
Meta Attrs: op_defaults-meta_attributes-1
  m=v
  Rule: boolean-op=and score=INFINITY
    Expression: resource ::Stateful
    Rule: boolean-op=or score=0
      Expression: op start
      Expression: op stop
      Expression: op promote

> OK


[root@virt-500 ~]# pcs resource op defaults set remove op_defaults-meta_attributes op_defaults-meta_attributes-1


[root@virt-500 ~]# pcs resource op defaults set create rule 'resource ::Stateful and (op start and op stop and (op promote or op demote))'
Warning: Defaults do not apply to resources which override them with their own defined values
[root@virt-500 ~]# echo $?
0
[root@virt-500 ~]# pcs resource op defaults
Meta Attrs: op_defaults-meta_attributes
  Rule: boolean-op=and score=INFINITY
    Expression: resource ::Stateful
    Rule: boolean-op=and score=0
      Expression: op start
      Expression: op stop
      Rule: boolean-op=or score=0
        Expression: op promote
        Expression: op demote


Marking as VERIFIED for pcs-0.10.6-4.el8.

Comment 11 errata-xmlrpc 2020-11-04 02:28:18 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 (pcs bug fix and enhancement update), 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/RHEA-2020:4617


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