Bug 1867516
Summary: | Resource and operation defaults with mixed and-or rules cause an invalid CIB error | ||||||
---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 8 | Reporter: | Tomas Jelinek <tojeline> | ||||
Component: | pcs | Assignee: | Tomas Jelinek <tojeline> | ||||
Status: | CLOSED ERRATA | QA Contact: | cluster-qe <cluster-qe> | ||||
Severity: | medium | Docs Contact: | |||||
Priority: | high | ||||||
Version: | 8.3 | CC: | cfeist, cluster-maint, idevat, mlisik, mmazoure, mpospisi, nwahl, omular, tojeline | ||||
Target Milestone: | rc | ||||||
Target Release: | 8.3 | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Whiteboard: | |||||||
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.
|
Story Points: | --- | ||||
Clone Of: | Environment: | ||||||
Last Closed: | 2020-11-04 02:28:18 UTC | Type: | Bug | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Attachments: |
|
Description
Tomas Jelinek
2020-08-10 08:48:58 UTC
Created attachment 1711043 [details]
proposed fix + tests
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 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. 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 |