neutron/neutron
Slawek Kaplonski 99602ab15b [DVR] Add lock during creation of FIP agent gateway port
In case when new external network is set as gateway network for
dvr router, neutron tries to create floating IP agent gateway port.
There should be always max 1 such port per network per L3 agent but
sometimes when there are 2 requests to set external gateway for 2
different routers executed almost in same time it may happend that
there will be 2 such ports created.
That will cause error with configuration of one of routers on L3 agent
and this will cause e.g. problems with access from VMs to metadata
service.
Such issues are visible in DVR CI jobs from time to time. Please check
related bug for details.

This patch adds lock mechanism during creation of such FIP gateway port.
Such solution isn't fully solving exising race condition as if 2
requests will be processed by api workers running on 2 different nodes
than this race can still happend.
But this should mitigate the issue a bit and solve problem in U/S gates
at least.
For proper fix we should probably add some constraint on database level
to prevent creation of 2 such ports for one network and one host but
such solution will not be easy to backport to stable branches so I would
prefer first to go with this easy workaround.

Conflicts:
    neutron/db/l3_dvr_db.py

Change-Id: Iabab7e4d36c7d6a876b2b74423efd7106a5f63f6
Related-Bug: #1830763
(cherry picked from commit 7b81c1bc67)
(cherry picked from commit f7532f0c92)
(cherry picked from commit 5c1afcaf2b)
2019-08-12 10:38:46 +02:00
..
agent Merge "Limit max ports per rpc for dhcp_ready_on_ports()" into stable/queens 2019-07-26 02:31:09 +00:00
api Optimize the code that fixes the race condition of DHCP agent. 2019-06-11 09:44:32 +08:00
cmd Secure dnsmasq process against external abuse 2019-01-25 13:58:19 +00:00
common Packets getting lost during SNAT with too many connections 2019-06-04 23:23:43 +00:00
conf Add custom ethertype processing 2019-07-01 11:01:56 +00:00
core_extensions use qos constants from neutron-lib 2017-10-26 19:57:19 +00:00
db [DVR] Add lock during creation of FIP agent gateway port 2019-08-12 10:38:46 +02:00
debug Change ip_lib network namespace code to use pyroute2 2017-10-04 21:09:28 +00:00
extensions Improve invalid port ranges error message 2019-03-21 10:18:01 -04:00
hacking hacking: Remove dead code 2017-07-19 13:43:44 +02:00
ipam Allow first address in an IPv6 subnet as valid unicast 2019-05-24 17:42:09 -04:00
locale Imported Translations from Zanata 2018-03-14 06:20:49 +00:00
notifiers use callback payloads for REQUEST/RESPONSE events 2017-12-24 07:27:11 +00:00
objects Use dynamic lazy mode for fetching security group rules 2019-04-30 14:00:38 -06:00
pecan_wsgi Use list instead of six.viewkeys to avoid py2 to py3 problems 2019-05-31 13:22:27 +00:00
plugins Don't crash ovs agent during reconfigure of phys bridges 2019-07-28 13:18:48 +00:00
privileged Add capabilities for privsep 2018-10-29 11:28:45 +00:00
quota Fetch specific columns rather than full ORM entities 2018-09-27 19:12:37 +02:00
scheduler Fetch specific columns rather than full ORM entities 2018-09-27 19:12:37 +02:00
server Make code follow log translation guideline 2017-08-14 02:01:48 +00:00
services Retry trunk status updates failing with StaleDataError 2019-07-31 07:24:46 +00:00
tests Retry trunk status updates failing with StaleDataError 2019-07-31 07:24:46 +00:00
__init__.py
_i18n.py Make code follow log translation guideline 2017-08-14 02:01:48 +00:00
auth.py Use oslo.context class method to construct context object 2017-03-23 09:02:46 +00:00
manager.py Do not load default service plugins if core plugin is not DB based 2017-11-09 20:34:52 +00:00
neutron_plugin_base_v2.py Do not load default service plugins if core plugin is not DB based 2017-11-09 20:34:52 +00:00
opts.py Merge "Remove deprecated cache_url" 2018-01-03 06:35:59 +00:00
policy.py Treat networks shared by RBAC in same way as shared with all tenants 2019-06-28 06:05:44 +00:00
service.py use callback payloads for _SPAWN events 2017-12-21 11:03:36 -07:00
version.py
worker.py replace WorkerSupportServiceMixin with neutron-lib's WorkerBase 2017-06-14 06:56:48 -06:00
wsgi.py Make code follow log translation guideline 2017-08-14 02:01:48 +00:00