Avoid ovs restart during package upgrade

When installing/upgrading packages (like ovs) a race-condition may occur
when neutron-ovs-agent tries to restore mesh while ovs is being spawning
down. This results in errors in neutron-ovs-agent like:
ovsdb-client: tcp:127.0.0.1:6640: Open_vSwitch database was removed
ovsdbapp.exceptions.TimeoutException: TXN queue is full

In order to prevent that we disable ablity to restart services on
package installation/upgrade, but do that with handler after
neutron-ovs-agent get stopped.

Change-Id: I4bd717c35e030aa1ede21d9a01460037d1ab070c
This commit is contained in:
Dmitriy Rabotyagov 2022-09-14 13:57:54 +02:00 committed by Dmitriy Rabotyagov
parent f2df86fb26
commit 435440a495
2 changed files with 12 additions and 1 deletions

View File

@ -70,6 +70,14 @@
- "Restart neutron services"
- "venv changed"
- name: Restart openvswitch
service:
name: "{{ neutron_ovs_service_name }}"
state: restarted
listen:
- "Restart provider services"
when: neutron_needs_openvswitch | bool
- name: Symlink neutron config directory
file:
# NOTE(cloudnull): The "src" path is relative. This ensures all files remain

View File

@ -29,12 +29,16 @@
package:
name: "{{ neutron_package_list }}"
state: "{{ neutron_package_state }}"
policy_rc_d: "{{ (neutron_needs_openvswitch | bool and ansible_facts['pkg_mgr'] == 'apt') | ternary(101, omit) }}"
update_cache: "{{ (ansible_facts['pkg_mgr'] == 'apt') | ternary('yes', omit) }}"
cache_valid_time: "{{ (ansible_facts['pkg_mgr'] == 'apt') | ternary(cache_timeout, omit) }}"
register: install_packages
until: install_packages is success
retries: 5
delay: 2
notify:
- "Restart neutron services"
- "Restart provider services"
- name: Remove known problem packages
package:
@ -70,7 +74,6 @@
venv_build_constraints: "{{ _u_c_contents.content.split('\n') | reject('match', '^(ceilometer|neutron)=') | list }}"
venv_build_distro_package_list: "{{ neutron_devel_distro_packages }}"
venv_install_destination_path: "{{ neutron_bin | dirname }}"
venv_install_distro_package_list: "{{ neutron_package_list }}"
venv_pip_install_args: "{{ neutron_pip_install_args }}"
venv_pip_packages: "{{ neutron_venv_packages }}"
venv_facts_when_changed: