Bug 1389941 - 'pcs booth remove' doesn't remove resources properly if the booth group is disabled
Summary: 'pcs booth remove' doesn't remove resources properly if the booth group is di...
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:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-10-29 18:24 UTC by Radek Steiger
Modified: 2017-08-01 18:24 UTC (History)
5 users (show)

(edit)
Cause: 
User runs the 'pcs booth remove' command when the booth resource group is disabled.

Consequence: 
The booth resource group is not removed completely.

Fix: 
Properly find the booth resource group in CIB even if it is disabled.

Result: 
The booth resource group is completely removed.
Clone Of:
(edit)
Last Closed: 2017-08-01 18:24:40 UTC


Attachments (Terms of Use)
proposed fix (6.98 KB, patch)
2016-11-10 11:37 UTC, Tomas Jelinek
no flags Details | Diff
proposed fix 2 (3.87 KB, patch)
2017-03-13 09:13 UTC, Tomas Jelinek
no flags Details | Diff


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

Description Radek Steiger 2016-10-29 18:24:37 UTC
> Description of problem:

Removing booth resource and its IPaddr2 sibling with 'pcs remove commands' fails when the group is disabled, leaving the IP resource in place and removing the booth-site instance only. This however doesn't happen when the group as such is enabled, but any of the resources is either disabled or stopped.

[root@virt-019 ~]# pcs status
...
 Resource Group: booth-booth-group
     booth-booth-ip	(ocf::heartbeat:IPaddr2):	Started virt-029.cluster-qe.lab.eng.brq.redhat.com
     booth-booth-service	(ocf::pacemaker:booth-site):	Started virt-029.cluster-qe.lab.eng.brq.redhat.com
...
[root@virt-019 ~]# pcs resource disable booth-booth-group
[root@virt-019 ~]# pcs status
...
 Resource Group: booth-booth-group
     booth-booth-ip	(ocf::heartbeat:IPaddr2):	Stopped (disabled)
     booth-booth-service	(ocf::pacemaker:booth-site):	Stopped (disabled)
...
[root@virt-019 ~]# pcs booth remove
Deleting Resource - booth-booth-service
[root@virt-019 ~]# pcs status
...
 Resource Group: booth-booth-group
     booth-booth-ip	(ocf::heartbeat:IPaddr2):	Stopped (disabled)
...


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

pcs-0.9.152-10.el7.x86_64


> How reproducible:

Always


> Steps to Reproduce:

1. pcs resource disable booth-booth-group
2. pcs booth remove


> Actual results:

[root@virt-019 ~]# pcs status | grep booth
 Resource Group: booth-booth-group
     booth-booth-ip	(ocf::heartbeat:IPaddr2):	Stopped (disabled)
[root@virt-019 ~]#


> Expected results:

[root@virt-019 ~]# pcs status | grep booth
[root@virt-019 ~]#

Comment 2 Tomas Jelinek 2016-11-10 11:37 UTC
Created attachment 1219333 [details]
proposed fix

Test is included in the patch.

Comment 4 Ivan Devat 2017-02-20 07:41:58 UTC
After Fix:

[vm-rhel72-1 ~] $ rpm -q pcs
pcs-0.9.156-1.el7.x86_64
[vm-rhel72-1 ~] $ pcs resource
NO resources configured
[vm-rhel72-1 ~] $ booth create ip 192.168.122.120
client operation "create" is unknown
[vm-rhel72-1 ~] $ pcs booth create ip 192.168.122.120
[vm-rhel72-1 ~] $ pcs resource disable booth-booth-group
[vm-rhel72-1 ~] $ pcs resource show
 Resource Group: booth-booth-group
     booth-booth-ip     (ocf::heartbeat:IPaddr2):       Stopped (disabled)
     booth-booth-service        (ocf::pacemaker:booth-site):    Stopped (disabled)
[vm-rhel72-1 ~] $ pcs booth remove
Deleting Resource - booth-booth-ip
Deleting Resource (and group) - booth-booth-service
[vm-rhel72-1 ~] $ pcs resource show
NO resources configured

Comment 6 Tomas Jelinek 2017-03-13 09:13 UTC
Created attachment 1262357 [details]
proposed fix 2

Fixed crash when the group's meta_attributes are placed before the group's resources in the CIB. See the test included in the patch for details.

Comment 7 Ivan Devat 2017-04-10 15:55:39 UTC
After Fix:

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

[vm-rhel72-1 ~] $ pcs resource
NO resources configured
[vm-rhel72-1 ~] $ pcs booth create ip 192.168.122.120
[vm-rhel72-1 ~] $ pcs resource disable booth-booth-group
[vm-rhel72-1 ~] $ pcs cluster cib|grep 'id="booth-booth-group"' -A4
      <group id="booth-booth-group">
        <meta_attributes id="booth-booth-group-meta_attributes">
          <nvpair id="booth-booth-group-meta_attributes-target-role" name="target-role" value="Stopped"/>
        </meta_attributes>
        <primitive class="ocf" id="booth-booth-ip" provider="heartbeat" type="IPaddr2">
[vm-rhel72-1 ~] $ pcs booth remove
Deleting Resource - booth-booth-ip
Deleting Resource (and group) - booth-booth-service
[vm-rhel72-1 ~] $ pcs resource
NO resources configured

> Note that meta_attributes element is placed before primitive elements.

Comment 11 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.