Bug 1420437 - cli: automatic CIB upgrade missing for "pcs constraint location add ... resource-discovery=..."
Summary: cli: automatic CIB upgrade missing for "pcs constraint location add ... resou...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: pcs
Version: 7.3
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-02-08 16:11 UTC by Radek Steiger
Modified: 2018-04-10 15:38 UTC (History)
5 users (show)

Fixed In Version: pcs-0.9.160-1.el7
Doc Type: Bug Fix
Doc Text:
Cause: The user specifies a resource-discovery option when creating a location constraint. Consequence: Pcs exits with an error and the constraint is not created. Fix: Automatically upgrade CIB schema version when the resource-discovery option has been used. Result: The location constraint gets created.
Clone Of:
Environment:
Last Closed: 2018-04-10 15:37:49 UTC
Target Upstream Version:


Attachments (Terms of Use)
proposed fix (3.90 KB, patch)
2017-09-01 16:05 UTC, Tomas Jelinek
no flags Details | Diff


Links
System ID Priority Status Summary Last Updated
Red Hat Bugzilla 1362493 None CLOSED pcs does not support rsc-pattern in location constraints 2019-06-04 11:19:27 UTC
Red Hat Product Errata RHBA-2018:0866 None None None 2018-04-10 15:38:37 UTC

Internal Links: 1362493

Description Radek Steiger 2017-02-08 16:11:37 UTC
> Description of problem:

When resource-discovery option support has been added to 'constraint location add' and 'constraint location rule', the automatic CIB upgrade to version pacemaker-2.2+ has only been to the rule creation. The former command is missing this step therefore resulting in an invalid CIB.


> Version-Release number of selected component (if applicable):

pcs-0.9.152-10.el7
(upstream also affected)


> How reproducible:

Always


> Steps to Reproduce:
1. have a CIB with validate-with="pacemaker-2.1" or lower
2. pcs resource create MyDummy ocf:heartbeat:Dummy
3. pcs constraint location add MyLoc MyDummy <node> 100 resource-discovery=exclusive


> Actual results:

Error: Unable to update cib
Call cib_replace failed (-203): Update does not conform to the configured schema
...


> Expected results:

Cluster CIB has been upgraded to latest version


> Additional info:

'location rule' code: https://github.com/ClusterLabs/pcs/blob/ba257076bf60ad7a624b645b306711f3525e6b1a/pcs/constraint.py#L729
'location add' code:  https://github.com/ClusterLabs/pcs/blob/ba257076bf60ad7a624b645b306711f3525e6b1a/pcs/constraint.py#L800

Comment 1 Tomas Jelinek 2017-02-09 09:36:51 UTC
We will add CIB upgrade check to that function with respect to rsc-pattern as a part of bz1362493 patch. So we can fix this in the same time.

Comment 3 Tomas Jelinek 2017-09-01 16:05:14 UTC
Created attachment 1321014 [details]
proposed fix

Comment 4 Ivan Devat 2017-10-11 08:12:35 UTC
After Fix:

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

[vm-rhel72-1 ~] $ cat cib-empty.xml
<cib epoch="557" num_updates="122" admin_epoch="0" validate-with="pacemaker-1.2" crm_feature_set="3.0.12" 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>
    </nodes>
    <resources/>
    <constraints/>
  </configuration>
  <status/>
</cib>
[vm-rhel72-1 ~] $ pcs resource create MyDummy ocf:heartbeat:Dummy -f cib-empty.xml
[vm-rhel72-1 ~] $ pcs constraint location add MyLoc MyDummy vm-rhel72-1 100 resource-discovery=exclusive  -f cib-empty.xml
Cluster CIB has been upgraded to latest version
[vm-rhel72-1 ~] $ echo $?
0

Comment 9 errata-xmlrpc 2018-04-10 15:37:49 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:0866


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