neutron/neutron/db
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
..
allowed_address_pairs Clean up deprecated sqla model import paths 2017-02-25 03:42:34 +00:00
availability_zone use l3 api def from neutron-lib 2017-12-15 07:03:14 -07:00
extra_dhcp_opt Cleanup _find_related_obj 2017-02-25 06:29:33 +00:00
metering Use Router OVO in metering_db 2018-01-16 09:50:57 +07:00
migration Update neutron files for new over-indentation hacking rule (E117) 2019-02-02 10:48:26 +00:00
models Use dynamic lazy mode for fetching security group rules 2019-04-30 14:00:38 -06:00
network_dhcp_agent_binding OVO for NetworkDhcpAgentBinding 2017-09-08 15:48:00 +00:00
port_security Cleanup _find_related_obj 2017-02-25 06:29:33 +00:00
qos [L3][QoS] Neutron server side Floating IP QoS 2017-11-29 16:45:38 +08:00
quota [trivial fix]fix typos in neutron 2017-12-31 06:43:52 +00:00
__init__.py
_model_query.py Reorder checks in apply_filters in db/_model_query 2017-11-01 09:44:26 +09:00
_resource_extend.py Refactor CommonDbMixin for removal 2017-04-25 14:13:30 -04:00
_utils.py Make code follow log translation guideline 2017-08-14 02:01:48 +00:00
address_scope_db.py use neutron-lib address scope apidef 2017-09-20 10:58:12 -06:00
agents_db.py Make port binding attempt after agent is revived 2018-10-23 11:00:50 +02:00
agentschedulers_db.py use agent api def from neutron-lib 2017-11-21 12:22:53 -07:00
allowedaddresspairs_db.py use addr pairs api def from lib 2017-11-13 11:56:32 -07:00
api.py Cleaned up get_session 2018-01-05 18:39:19 +00:00
common_db_mixin.py Move _get_marker_obj() out of CommonDbMixin. 2017-05-02 16:47:42 +00:00
data_plane_status_db.py Eliminate lookup of "resource extend" funcs by name 2017-04-21 14:48:42 -04:00
db_base_plugin_common.py Turn CIDR in query filter into proper subnet 2019-06-26 10:25:10 +02:00
db_base_plugin_v2.py Get ports query: extract limit and use it only at the end. 2019-05-02 10:11:07 +00:00
dns_db.py use l3 api def from neutron-lib 2017-12-15 07:03:14 -07:00
dvr_mac_db.py use dvr api def from neutron-lib 2017-11-13 10:27:16 -07:00
external_net_db.py Fetch specific columns rather than full ORM entities 2018-09-27 19:12:37 +02:00
extradhcpopt_db.py use core resource attribute constants from neutron-lib 2017-06-30 06:25:36 -06:00
extraroute_db.py use l3 api def from neutron-lib 2017-12-15 07:03:14 -07:00
flavors_db.py use flavors api def from neutron-lib 2017-11-17 10:21:28 -07:00
ipam_backend_mixin.py Allow first address in an IPv6 subnet as valid unicast 2019-05-24 17:42:09 -04:00
ipam_pluggable_backend.py Allow first address in an IPv6 subnet as valid unicast 2019-05-24 17:42:09 -04:00
l3_agentschedulers_db.py Handle AgentNotFoundByTypeHost exception properly 2018-04-13 07:11:18 +00:00
l3_attrs_db.py use l3 api def from neutron-lib 2017-12-15 07:03:14 -07:00
l3_db.py Check port VNIC type when associating a floating IP 2019-01-18 18:24:31 +01:00
l3_dvr_db.py [DVR] Add lock during creation of FIP agent gateway port 2019-08-12 10:38:46 +02:00
l3_dvr_ha_scheduler_db.py Fix connection between 2 dvr routers 2018-11-14 20:48:56 +00:00
l3_dvrscheduler_db.py DVR: on new port only send router update on port's host 2019-06-17 23:52:59 +00:00
l3_fip_qos.py Allow objects to opt in new engine facade 2018-02-09 04:07:34 +00:00
l3_gwmode_db.py use l3 api def from neutron-lib 2017-12-15 07:03:14 -07:00
l3_hamode_db.py Ensure dvr ha router gateway port binding host 2019-05-16 19:33:08 +00:00
l3_hascheduler_db.py use service type constants from neutron_lib plugins 2017-06-27 15:16:05 -06:00
models_v2.py Allow to set/modify network mtu 2017-08-11 00:57:34 +00:00
network_ip_availability_db.py Add network ip availability filtered by project_id 2017-08-23 08:53:25 +08:00
portbindings_base.py use core resource attribute constants from neutron-lib 2017-06-30 06:25:36 -06:00
portbindings_db.py Fetch specific columns rather than full ORM entities 2018-09-27 19:12:37 +02:00
portsecurity_db.py use core resource attribute constants from neutron-lib 2017-06-30 06:25:36 -06:00
portsecurity_db_common.py use neutron-lib port security api-def 2017-05-01 11:45:42 -06:00
provisioning_blocks.py Fetch specific columns rather than full ORM entities 2018-09-27 19:12:37 +02:00
quota_db.py Create packages for quota modules 2015-07-28 11:55:01 -07:00
rbac_db_mixin.py Fetch specific columns rather than full ORM entities 2018-09-27 19:12:37 +02:00
rbac_db_models.py Bump network rev on RBAC change 2017-08-02 16:44:01 +00:00
securitygroups_db.py Show all SG rules belong to SG in group's details 2019-05-24 15:16:21 +02:00
securitygroups_rpc_base.py remove neutron.callbacks package 2018-01-16 09:32:32 -07:00
segments_db.py Make code follow log translation guideline 2017-08-14 02:01:48 +00:00
servicetype_db.py Clean up deprecated sqla model import paths 2017-02-25 03:42:34 +00:00
sqlalchemytypes.py For typo in sqlalchemytypes 2017-02-13 16:18:46 +00:00
standard_attr.py Make code follow log translation guideline 2017-08-14 02:01:48 +00:00
standardattrdescription_db.py Eliminate lookup of "resource extend" funcs by name 2017-04-21 14:48:42 -04:00
subnet_service_type_db_models.py use core resource attribute constants from neutron-lib 2017-06-30 06:25:36 -06:00
tag_db.py Clean up deprecated sqla model import paths 2017-02-25 03:42:34 +00:00
vlantransparent_db.py use core resource attribute constants from neutron-lib 2017-06-30 06:25:36 -06:00