Bug 1267265
| Summary: | A change in "crm_resource --set-parameter is-managed" introduces regression for Clone and M/S resources | |||
|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Radek Steiger <rsteiger> | |
| Component: | pacemaker | Assignee: | Andrew Beekhof <abeekhof> | |
| Status: | CLOSED ERRATA | QA Contact: | cluster-qe <cluster-qe> | |
| Severity: | high | Docs Contact: | ||
| Priority: | high | |||
| Version: | 7.2 | CC: | cfeist, cluster-maint, fdinitto, tlavigne, tojeline | |
| Target Milestone: | rc | Keywords: | Regression | |
| Target Release: | --- | |||
| Hardware: | Unspecified | |||
| OS: | Unspecified | |||
| Whiteboard: | ||||
| Fixed In Version: | pacemaker-1.1.13-10.el7 | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | ||
| Clone Of: | ||||
| : | 1268801 (view as bug list) | Environment: | ||
| Last Closed: | 2015-11-19 12:12:01 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: | ||||
| Bug Depends On: | ||||
| Bug Blocks: | 1268801 | |||
|
Description
Radek Steiger
2015-09-29 13:43:07 UTC
Expected usage: Users should always refer to the outer-most container when calling crm_resource.
Except users don't take the time to learn about that :-(
So we now allow them to refer to the uncloned resource, but it is a relatively new affordance and we try to help people set meta attributes in the correct place.
Which is what introduced the bug.
So I have fixed the bug reported here:
[05:11 PM] beekhof@fedora ~/Development/sources/pacemaker/devel ☺ # cp managed.xml foo.xml; CIB_file=./foo.xml tools/crm_resource --resource stateful0 --set-parameter is-managed --meta --parameter-value true ; cat foo.xml | grep nvpair
Set 'stateful0' option: id=stateful0-meta_attributes-is-managed name=is-managed=true
<nvpair id="stateful0-meta_attributes-is-managed" name="is-managed" value="true"/>
New attributes still go to the parent by default:
[05:12 PM] beekhof@fedora ~/Development/sources/pacemaker/devel ☺ # cp managed.xml foo.xml; CIB_file=./foo.xml tools/crm_resource --resource stateful0 --set-parameter target-role --meta --parameter-value Stopped ; cat foo.xml | grep nvpair
Updating 'target-role' on 'stateful0-master' the parent of 'stateful0'
Set 'stateful0-master' option: id=stateful0-master-meta_attributes-target-role set=stateful0-master-meta_attributes name=target-role=Stopped
<nvpair id="stateful0-meta_attributes-is-managed" name="is-managed" value="false"/>
<nvpair id="stateful0-master-meta_attributes-target-role" name="target-role" value="Stopped"/>
However they can use --force if they really insist.
[05:13 PM] beekhof@fedora ~/Development/sources/pacemaker/devel ☺ # cp managed.xml foo.xml; CIB_file=./foo.xml tools/crm_resource --resource stateful0 --set-parameter target-role --meta --parameter-value Stopped --force ; cat foo.xml | grep nvpair
Forcing update of 'stateful0' instead of 'stateful0-master'
Set 'stateful0' option: id=stateful0-meta_attributes-target-role set=stateful0-meta_attributes name=target-role=Stopped
<nvpair id="stateful0-meta_attributes-is-managed" name="is-managed" value="false"/>
<nvpair id="stateful0-meta_attributes-target-role" name="target-role" value="Stopped"/>
And if they use the clone like they should have all along, they still get the right result:
[05:27 PM] beekhof@fedora ~/Development/sources/pacemaker/devel ☺ # cp managed.xml foo.xml; CIB_file=./foo.xml tools/crm_resource --resource stateful0-master --set-parameter is-managed --meta --parameter-value true ; cat foo.xml | grep nvpair
A value for 'is-managed' already exists in child 'stateful0', updating that instead of 'stateful0-master'
Set 'stateful0' option: id=stateful0-meta_attributes-is-managed name=is-managed=true
<nvpair id="stateful0-meta_attributes-is-managed" name="is-managed" value="true"/>
Upstream patch is https://github.com/beekhof/pacemaker/commit/f367348
O-kay, here we go... tl;dr - We now look for and summarise duplicates, plus the --force option now works for deletions and in the presence of duplicates. Anything else? # cp dups.xml foo.xml; CIB_file=./foo.xml tools/crm_resource -r stateful0-master --meta -p is-managed -v true Multiple attributes match name=is-managed Value: false (id=stateful0-meta_attributes-is-managed) Value: false (id=stateful0-clone-meta_attributes-is-managed) A value for 'is-managed' already exists in child 'stateful0', performing update on that instead of 'stateful0-master' Set 'stateful0' option: id=stateful0-meta_attributes-is-managed name=is-managed=true # cp dups.xml foo.xml; CIB_file=./foo.xml tools/crm_resource -r stateful0-master --meta -p is-managed -v true --force Set 'stateful0-master' option: id=stateful0-clone-meta_attributes-is-managed name=is-managed=true # cp dups.xml foo.xml; CIB_file=./foo.xml tools/crm_resource -r stateful0 --meta -p is-managed -v true Multiple attributes match name=is-managed Value: false (id=stateful0-meta_attributes-is-managed) Value: false (id=stateful0-clone-meta_attributes-is-managed) Set 'stateful0' option: id=stateful0-meta_attributes-is-managed name=is-managed=true # cp dups.xml foo.xml; CIB_file=./foo.xml tools/crm_resource -r stateful0 --meta -p is-managed -v true --force Set 'stateful0' option: id=stateful0-meta_attributes-is-managed name=is-managed=true # cp managed.xml foo.xml; CIB_file=foo.xml tools/crm_resource -r stateful0-master --meta -p is-managed -v true A value for 'is-managed' already exists in child 'stateful0', performing update on that instead of 'stateful0-master' Set 'stateful0' option: id=stateful0-meta_attributes-is-managed name=is-managed=true # cp managed.xml foo.xml; CIB_file=foo.xml tools/crm_resource -r stateful0-master --meta -p is-managed -v true --force Set 'stateful0-master' option: id=stateful0-master-meta_attributes-is-managed set=stateful0-master-meta_attributes name=is-managed=true # cp managed.xml foo.xml; CIB_file=foo.xml tools/crm_resource -r stateful0 --meta -p is-managed -v true Set 'stateful0' option: id=stateful0-meta_attributes-is-managed name=is-managed=true # cp managed.xml foo.xml; CIB_file=foo.xml tools/crm_resource -r stateful0 --meta -p is-managed -v true --force Set 'stateful0' option: id=stateful0-meta_attributes-is-managed name=is-managed=true # cp ../dups.xml foo.xml; CIB_file=./foo.xml tools/crm_resource -r stateful0 --meta -d is-managed Multiple attributes match name=is-managed Value: false (id=stateful0-meta_attributes-is-managed) Value: false (id=stateful0-clone-meta_attributes-is-managed) Deleted 'stateful0' option: id=stateful0-meta_attributes-is-managed name=is-managed # cp ../dups.xml foo.xml; CIB_file=./foo.xml tools/crm_resource -r stateful0 --meta -d is-managed --force Deleted 'stateful0' option: id=stateful0-meta_attributes-is-managed name=is-managed # cp ../dups.xml foo.xml; CIB_file=./foo.xml tools/crm_resource -r stateful0-master --meta -d is-managed Multiple attributes match name=is-managed Value: false (id=stateful0-meta_attributes-is-managed) Value: false (id=stateful0-clone-meta_attributes-is-managed) A value for 'is-managed' already exists in child 'stateful0', performing delete on that instead of 'stateful0-master' Deleted 'stateful0' option: id=stateful0-meta_attributes-is-managed name=is-managed # cp ../dups.xml foo.xml; CIB_file=./foo.xml tools/crm_resource -r stateful0-master --meta -d is-managed --force Deleted 'stateful0-master' option: id=stateful0-clone-meta_attributes-is-managed name=is-managed As a bonus if there is no duplicate but you specify the "wrong" resource: # CIB_file=./foo.xml tools/crm_resource -r stateful0-master --meta -d is-managed A value for 'is-managed' already exists in child 'stateful0', performing delete on that instead of 'stateful0-master' Deleted 'stateful0' option: id=stateful0-meta_attributes-is-managed name=is-managed and # CIB_file=./foo.xml tools/crm_resource -r stateful0 --meta -d is-managed Performing delete of 'is-managed' on 'stateful0-master', the parent of 'stateful0' Deleted 'stateful0-master' option: id=stateful0-clone-meta_attributes-is-managed name=is-managed Forgot to update bug status Adding to the errata 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://rhn.redhat.com/errata/RHSA-2015-2383.html |