ClusterLabs / pcs

Pacemaker command line interface and GUI
GNU General Public License v2.0
250 stars 116 forks source link

"pcs resource delete <resource>" shall cleanup the respective failed operations, writing them to stdout #194

Open jnpkrn opened 5 years ago

jnpkrn commented 5 years ago

Current flow makes little sense:

touch /etc/init.d/nonexisting_test.sh
pcs resource create test lsb:nonexisting_test.sh
pcs status
[...]
Full list of resources:

 test (lsb:nonexisting_test.sh):  FAILED mymachine (blocked)

Failed Resource Actions:
* test_stop_0 on mymachine 'insufficient privileges' (4): call=42, status=complete, exitreason='',
    last-rc-change='Mon Feb 18 22:05:14 2019', queued=1ms, exec=3ms
[...]
pcs resource delete test
Deleting Resource - test
pcs status
Full list of resources:

 test (lsb:nonexisting_test.sh):   ORPHANED FAILED mymachine (blocked)

Failed Resource Actions:
* test_stop_0 on mymachine 'insufficient privileges' (4): call=42, status=complete, exitreason='',
    last-rc-change='Mon Feb 18 22:05:14 2019', queued=1ms, exec=3ms

I'd suggest that the output of resource delete test is:

Deleting Resource - test
Removing respective failed resource actions - test:
* test_stop_0 on mymachine 'insufficient privileges' (4): call=42, status=complete, exitreason='',
    last-rc-change='Mon Feb 18 22:05:14 2019', queued=1ms, exec=3ms

and that

crm_resource -C -r <resource>
crm_resource -D -r <resource> -t <type>

sequence is called under the hood (possibly simplified later into a single invocation only to prevent race conditions -- currently unsupported with crm_resource).

Part of the suggestion is that, e.g., --keep-floating option is added to preserve original semantics (which, I can imagine, is hardly desirable as a default -- it's very confusing that something non-existent keeps any traces around).

tomjelinek commented 4 years ago

This is tracked at https://bugzilla.redhat.com/show_bug.cgi?id=1420298#c18