Red Hat Bugzilla – Bug 1198274
pcsd: don't automatically use --force everytime a resource is being removed
Last modified: 2015-11-19 04:35:57 EST
> Description of problem: The piece of code responsible for removing resources calls pcs cli with --force flag everytime a resource is being removed. This is helpful in situations when a standard removal procedure fails, but may lead to unforseen consequences when a gracefull stop/remove would actually work just fine. One reproducer I've been able to hit is this: 1. Create a stateful resource: # pcs resource create stateful0 Stateful state=/tmp/statefile --master 2. Use the GUI to remove a resource (which is the same as running 'pcs --force resource delete stateful0') 3. The resource ends up in orphaned state The reproducer might not be 100%, in which case disabling orphan autostop will make it easier to reproduce: 'pcs property set stop-orphan-resources=false'. We need to find a better way of removing resources reliably without causing unwanted issues like this reproducer. > Version-Release number of selected component (if applicable): pcs-0.9.137-10.el7 > Additional info: Patch at fault: https://github.com/feist/pcs/commit/0daf1585f3af30047c914c4b8a0bc8a884612cdb
Created attachment 1037335 [details] proposed fix Test: There is a checkbox in the Resource Removal dialog which controls the --force flag of the 'pcs resource remove' command. When the checkbox is empty, pcs will wait for the removed resource to stop, otherwise it will delete the resource without stopping it first.
Before Fix: [root@rh71-node1 ~]# rpm -q pcs pcs-0.9.140-1.el7.x86_64 [root@rh71-node1:~]# pcs resource create delay delay startdelay=0 stopdelay=10 Delete the delay resource using web UI, then immediately: [root@rh71-node1:~]# pcs resource delay (ocf::heartbeat:Delay): ORPHANED Started rh71-node1 After Fix: [root@rh71-node1:~]# rpm -q pcs pcs-0.9.141-1.el7.x86_64 [root@rh71-node1:~]# pcs resource create delay delay startdelay=0 stopdelay=10 Delete the delay resource using web UI, a dialog is displayed asking if you want to force the deletion. If you do not enforce it the resource is stopped first and then deleted.
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-2290.html