ClusterLabs / resource-agents

Combined repository of OCF agents from the RHCS and Linux-HA projects
GNU General Public License v2.0
493 stars 580 forks source link

LVM-activate: Fix return codes #1783

Closed nrwahl2 closed 2 years ago

nrwahl2 commented 2 years ago

Splitting this commit out from #1600.

OCF_ERR_ARGS should be used when the configuration isn't valid for the local node, and so the resource should not attempt to start again locally until the issue is corrected.

OCF_ERR_CONFIGURED should be used when the configuration isn't valid on any node, and so the resource should not attempt to start again anywhere until the issue is corrected.

One remaining gray area:

More info about return code meanings:

Resolves: RHBZ#1905820

Signed-off-by: Reid Wahl nrwahl@protonmail.com

oalbrigt commented 2 years ago

One remaining gray area:

* Should lvmlockd/clvmd improperly running (or improperly not running)
  be an OCF_ERR_GENERIC or OCF_ERR_ARGS? The fact that it's a state issue
  rather than a config issue suggests OCF_ERR_GENERIC. The fact that it
  won't be fixed without user intervention suggests OCF_ERR_ARGS.

I would say _GENERIC. _ARGS would make sense if it can only happen due to incorrect configuration of the resource or lvm.conf. Also _ARGS would make it not try to restart, so _GENERIC let's it recover if it's just a user error or it died.

nrwahl2 commented 2 years ago

Also _ARGS would make it not try to restart, so _GENERIC let's it recover if it's just a user error or it died.

The clvmd_check and lvmlockd_check functions are invoked only during a start operation (through validate-all). So as long as start-failure-is-fatal=true, the behavior would be identical for _ARGS and _GENERIC.

In the case that start-failure-is-fatal=false

I'm on the fence about the "improperly running" case. But there is not much practical significance. I'm pushing an update that uses _GENERIC for both. Happy to go either direction.

oalbrigt commented 2 years ago

Thanks.