Service restarts are not handled via Pacemaker for HA scenarios that use it
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
charms.openstack |
Fix Released
|
High
|
Dmitrii Shcherbakov |
Bug Description
While looking at https:/
Moreover, when service lifetime management is given to Pacemaker, it is better not to interfere with its operations via manual service restarts and use cluster resource lifecycle commands instead:
crm -w resource {start,
The -w option makes the CLI commands to wait for the completion of a transition instead of kicking off the asynchronous process and exiting.
https:/
It seems like there needs to be a way in charms.openstack to trigger `crm -w resource restart` instead of restarting services via init system-specific commands (systemd, upstart). This would allow Pacemaker to restart only the units that actually have the resource scheduled.
Example:
1) while the services list is empty
https:/
2) restart_on_change would still build a list of services from the restart map and restart them via charmhelpers.
-------
Considerations for restarting resources via crm commands:
1) crmsh restart commands are not node-specific and we would like to avoid causing cluster-wide restarts triggered by unit-local operations:
https:/
2) crm_resource has --restart and --wait commands and a --node option:
https:/
https:/
--restart
(Advanced) Tell the cluster to restart this resource and anything that depends on it
--wait (Advanced) Wait until the cluster settles into a stable state
-N, --node=value Node name
Based on the implementation, if a resource isn't running on the specified host, the command will exit with -ENXIO
https:/
https:/
So running the following from the charm and catching errno.ENXIO seems like a way forward:
crm_resource --restart --wait --node <node-name>
The only alternative to using crm_resource I see is a combination of `ban` + `clear` commands but the clear command doesn't accept the node argument based on the docs:
https:/
https:/
description: | updated |
Changed in charms.openstack: | |
assignee: | nobody → Dmitrii Shcherbakov (dmitriis) |
importance: | Undecided → High |
https:/ /review. opendev. org/745896