Browse Source

junos: Retry call to the switch if DB was locked

In case of concurrent requests to Neutron server ansible is not fast
enough to update ports on switch side and it happens two requests are
trying to update switch port at a time. Junos is not able to handle that
as it requires to commit changes before making any new changes.

This patch implements optimistic approach by retrying failed tasks in
case message about concurrency appears. This is specific to Junos and
hence goes to the provider directory.

Change-Id: I19b170d7b0ef5ec7f7c6690f6a07f7f9cda21639
Story: 2004409
Task: 28051
Jakub Libosvar 5 months ago
parent
commit
c29b086d70
1 changed files with 4 additions and 0 deletions
  1. 4
    0
      etc/ansible/roles/openstack-ml2/providers/junos/netconf.yaml

+ 4
- 0
etc/ansible/roles/openstack-ml2/providers/junos/netconf.yaml View File

@@ -25,3 +25,7 @@
25 25
   netconf_config:
26 26
     xml: "{{ lookup('template', ml2_junos_netconf_template) }}"
27 27
   connection: netconf
28
+  register: result
29
+  retries: 5
30
+  delay: 1
31
+  until: result.msg is not defined or result.msg.find('configuration database locked by:') == -1

Loading…
Cancel
Save