Bug 1186527

Summary: pcs reports a failure on stopping M/S resource when only slaves are running
Product: Red Hat Enterprise Linux 7 Reporter: Radek Steiger <rsteiger>
Component: pcsAssignee: Tomas Jelinek <tojeline>
Status: CLOSED DUPLICATE QA Contact: cluster-qe <cluster-qe>
Severity: unspecified Docs Contact:
Priority: high    
Version: 7.1CC: cluster-maint, tojeline
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: User stops / deletes a multi-state resource with only slaves running and no master instance running. Consequence: Pcs reports error saying it was not able to stop the resource even though the resource has stopped. Fix: Check for both master and slave instances of the resource. Result: Pcs reports the resource has stopped / has been deleted.
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-26 10:10:45 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:

Description Radek Steiger 2015-01-27 21:26:46 UTC
> Description of problem:

When a M/S resource is running as slave only via master-max=0, pcs has issues recognizing true state of the resources. Both disabling and deleting such resource reports that stopping failed, which is however not true as seen from the status output below.


> Reproducer 1:

[root@virt-010 ~]# pcs resource create stateful0 Stateful --master meta master-max=0 clone-max=1 

[root@virt-010 ~]# pcs resource 
 Master/Slave Set: stateful0-master [stateful0]
     Slaves: [ virt-010 ]

[root@virt-010 ~]# pcs resource delete stateful0
Attempting to stop: stateful0...Error: Unable to stop: stateful0 before deleting (re-run with --force to force deletion)

[root@virt-010 ~]# pcs resource 
 Master/Slave Set: stateful0-master [stateful0]
     Stopped: [ virt-010 virt-011 virt-012 ]

[root@virt-010 ~]# pcs resource delete stateful0
Deleting Resource - stateful0


> Reproducer 2:

[root@virt-010 ~]# pcs resource create stateful0 Stateful --master meta master-max=0 clone-max=1 

[root@virt-010 ~]# pcs resource 
 Master/Slave Set: stateful0-master [stateful0]
     Slaves: [ virt-010 ]

[root@virt-010 ~]# pcs resource disable stateful0 --wait
Error: unable to stop: 'stateful0', please check logs for failure information
Resource 'stateful0' is slave on node virt-010.

[root@virt-010 ~]# pcs resource 
 Master/Slave Set: stateful0-master [stateful0]
     Stopped: [ virt-010 virt-011 virt-012 ]


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

pcs-0.9.137-13.el7

Comment 1 Tomas Jelinek 2015-03-17 14:52:35 UTC
Patch in upstream:
https://github.com/feist/pcs/commit/900274a059fe6dd6ffef1ac84d7f67c92a392f33


Tests:

> Reproducer 1:
[root@rh70-node1:~]# pcs resource create stateful0 Stateful --master meta master-max=0 clone-max=1
[root@rh70-node1:~]# pcs resource
 Master/Slave Set: stateful0-master [stateful0]
     Slaves: [ rh70-node3 ]
[root@rh70-node1:~]# pcs resource delete stateful0
Attempting to stop: stateful0...Stopped
[root@rh70-node1:~]# echo $?
0
[root@rh70-node1:~]# pcs resource

> Reproducer 2:
[root@rh70-node1:~]# pcs resource create stateful0 Stateful --master meta master-max=0 clone-max=1
[root@rh70-node1:~]# pcs resource
 Master/Slave Set: stateful0-master [stateful0]
     Slaves: [ rh70-node3 ]
[root@rh70-node1:~]# pcs resource disable stateful0 --wait
Resource 'stateful0' is not running on any node
[root@rh70-node1:~]# echo $?
0
[root@rh70-node1:~]# pcs resource
 Master/Slave Set: stateful0-master [stateful0]
     Stopped: [ rh70-node1 rh70-node2 rh70-node3 ]