openstack-ansible-os_cinder/tasks
Dmitriy Rabotyagov 7e2cf5283f Restart cinder-purge-deleted service only on abnormal exit
Default value of Restart for any service which type is not `oneshot` is
`on-failure`. While this suits most usecases, this leads to unexpected
consequences for cinder-purge-deleted.service.

In case there're some historical inconsistencies in the database which
make impossible to flush deleted volumes from the database
(ie due to prior manual intervention), cinder-manage exists with code 1
which triggers systemd to restart the service and attempt cleanup again.

The troublesome part is the transactional behaviour of the script. With
each run it locks records in it's transaction that is failing and being
reverted in a loops with 2 sec delay, that not only causes unnecessary
load for database itself, but also causes deadlocks during operations
with volumes that are not being re-tryed and fail with 500 return code
in cinder-api.

Changing Restart to `on-abnormal` will leave service in a failed state
and systemd won't attempt to restart it.

Change-Id: Ib091cc11a16fcd31ef351d9ec21d070d25829791
2023-11-08 09:01:19 +00:00
..
cinder_backends.yml Fix linters and metadata 2023-07-14 12:58:19 +00:00
cinder_cleanup_old_facts.yml Fix linters and metadata 2023-07-14 12:58:19 +00:00
cinder_db_post_setup.yml Fix linters and metadata 2023-07-14 12:58:19 +00:00
cinder_db_sync.yml Move online data migrations to post-restart step 2023-04-12 19:09:30 +02:00
cinder_install.yml Fix linters and metadata 2023-07-14 12:58:19 +00:00
cinder_install_source.yml Remove rsync requirement for cinder 2023-01-10 15:09:56 +01:00
cinder_lvm_config.yml Fix linters and metadata 2023-07-14 12:58:19 +00:00
cinder_post_install.yml Fix linters and metadata 2023-07-14 12:58:19 +00:00
cinder_pre_install.yml Fix linters and metadata 2023-07-14 12:58:19 +00:00
cinder_qos.yml Fix linters and metadata 2023-07-14 12:58:19 +00:00
main.yml Restart cinder-purge-deleted service only on abnormal exit 2023-11-08 09:01:19 +00:00