Skip to content

Commit 4d61344

Browse files
committed
cinder: restart services after upgrade
This patch is roughly an adaptation of Ia6fc9011ee6f5461f40a1307b72709d769814a79 for cinder. During an upgrade, cinder pins the version of RPC calls to the minimum seen across all services. This ensures that old services do not receive data they cannot handle. After the upgrade is complete, all cinder services are supposed to be reloaded to cause them to check again the RPC versions of services and use the new latest version which should now be supported by all running services. There is a second issue in that it takes some time for the upgraded services to update the cinder services database table with their new version. We need to wait until all cinder services have done this before the restart is performed, otherwise the RPC version cap will remain in place. There is currently no interface in cinder available for checking these versions, so as a workaround we use a configurable delay with a default duration of 30 seconds, as we do for nova. This change restarts all cinder services after an upgrade, after a 30 second delay. Closes-Bug: #1954932 Related-Bug: #1833069 Change-Id: I9164dc589386d2c2d4daf1bf84061b806ba9988d (cherry picked from commit 80a32c3)
1 parent fd99f70 commit 4d61344

File tree

5 files changed

+47
-0
lines changed

5 files changed

+47
-0
lines changed

ansible/roles/cinder/defaults/main.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,15 @@ cinder_logging_debug: "{{ openstack_logging_debug }}"
201201

202202
openstack_cinder_auth: "{{ openstack_auth }}"
203203

204+
# After upgrading cinder, services will have an RPC version cap in place. We
205+
# need to restart all services in order to allow them to use the latest RPC
206+
# version. Ideally, there would be a way to check whether all cinder services
207+
# are using the latest version, but currently there is not. Instead, wait a
208+
# short time for all cinder services to update the version of their service in
209+
# the database. This seems to take around 10 seconds, but the default is 30 to
210+
# allow room for slowness.
211+
cinder_rpc_version_startup_delay: 30
212+
204213

205214
####################
206215
# Cinder

ansible/roles/cinder/handlers/main.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,23 @@
6666
healthcheck: "{{ service.healthcheck | default(omit) }}"
6767
when:
6868
- kolla_action != "config"
69+
70+
# NOTE(mgoddard): After upgrading cinder, services will have an RPC version cap
71+
# in place. We need to restart all services in order to allow them to use the
72+
# latest RPC version. Ideally, there would be a way to check whether all cinder
73+
# services are using the latest version, but currently there is not. Instead,
74+
# wait a short time for all cinder services to update the version of their
75+
# service in the database. This seems to take around 10 seconds, but the
76+
# default is 30 to allow room for slowness.
77+
78+
- name: Wait for cinder services to update service versions
79+
pause:
80+
seconds: "{{ cinder_rpc_version_startup_delay }}"
81+
run_once: true
82+
when:
83+
- kolla_action == 'upgrade'
84+
listen:
85+
- Restart cinder-api container
86+
- Restart cinder-scheduler container
87+
- Restart cinder-volume container
88+
- Restart cinder-backup container
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
- name: Reload cinder services to remove RPC version pin
3+
vars:
4+
service: "{{ item.value }}"
5+
become: true
6+
kolla_docker:
7+
action: "restart_container"
8+
common_options: "{{ docker_common_options }}"
9+
name: "{{ service.container_name }}"
10+
with_dict: "{{ cinder_services | select_services_enabled_and_mapped_to_host }}"

ansible/roles/cinder/tasks/upgrade.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
- name: Flush handlers
1414
meta: flush_handlers
1515

16+
- import_tasks: reload.yml
17+
1618
- name: Running Cinder online schema migration
1719
vars:
1820
cinder_api: "{{ cinder_services['cinder-api'] }}"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
fixes:
3+
- |
4+
Fixes an issue with Cinder upgrade where Cinder services would remain
5+
pinned to the previous release's RPC & object versions. `LP#1954932
6+
<https://bugs.launchpad.net/kolla-ansible/+bug/1954932>`__

0 commit comments

Comments
 (0)