neutron/neutron/db
ZhaoBo 4088461ed6 [server side] Fix race issue for port forwarding plugin
This patch fixes the race condition with update/delete neutron
serveral resources, such as port forwarding conflict with
floatingip and port forwarding conflict with port.

Also this approach need the revision function, so need to fix in port
forwarding model to aware relationship revision update.

As the port forwarding resource associated with 2 resources,
one is floatingip, the other is neutron internal port.
So floatingip update/delete maybe in a conflict situation with
port forwarding creation. But for port, we just lack the logic to
process port forwarding during update port's fixed_ip and delete
port.

So the approach here is adding logic to let l3 plugin and port
forwarding plugin know each other when both sides may process the same
floatingip resource. Based on the existing revision_number feature,
if one side fail as db staleError, the api layer will retry the whole
operation for this resource, so there must be a failure on one side in
this case. This patch just adds the association logic for l3 plugin and
port forwarding plugin, also adds a event receiver for port update/delete.

Then the behavior about the port forwarding associated resources would
be:
* For fip resource, I introduce one function in that patch.
  _check_floatingip_request
So during floatingip update/delete, the function will process
fip and check by rpc callback from l3_plugin, if port forwarding plugin
also creates a port forwarding with the same fip at this moment. The
success side would be the one who update the fip_db first, the other side
would be failure after db retry.

* For port resource, during update port fixed_ip or delete port, we will
delete the associated port forwarding resources for free the
fip:external_port socket.

Partially-Implements: blueprint port-forwarding
Change-Id: I637ebcb33b91d899a077bded5ca10097a830a847
Partial-Bug: #1491317
2018-08-01 02:45:14 +08:00
..
allowed_address_pairs Clean up deprecated sqla model import paths 2017-02-25 03:42:34 +00:00
availability_zone use is_extension_supported from neutron-lib 2018-03-12 09:28:52 -06:00
extra_dhcp_opt Cleanup _find_related_obj 2017-02-25 06:29:33 +00:00
metering use db utils from lib 2018-07-02 08:24:36 -06:00
migration [server side] Floating IP port forwarding OVO and db script 2018-07-16 11:17:45 +08:00
models [server side] Fix race issue for port forwarding plugin 2018-08-01 02:45:14 +08: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 Fix all pep8 E265 errors 2018-04-30 16:35:52 -04:00
__init__.py Update License Headers to replace Nicira with VMware 2014-02-27 08:11:15 +00:00
_model_query.py use db utils from lib 2018-07-02 08:24:36 -06:00
_resource_extend.py use make_weak_ref and resolve_ref from neutron-lib 2018-06-11 11:10:53 -06:00
_utils.py use db utils from lib 2018-07-02 08:24:36 -06:00
address_scope_db.py use db utils from lib 2018-07-02 08:24:36 -06:00
agents_db.py Merge "use retry_db_errors from neutron-lib" 2018-07-17 11:05:43 +00:00
agentschedulers_db.py Fix unscheduling fail when concurrent port delete 2018-06-09 02:58:20 +08:00
allowedaddresspairs_db.py use db utils from lib 2018-07-02 08:24:36 -06:00
api.py use sqla functions from neutron-lib 2018-07-25 21:04:20 +00:00
common_db_mixin.py use db utils from lib 2018-07-02 08:24:36 -06: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 use db utils from lib 2018-07-02 08:24:36 -06:00
db_base_plugin_v2.py Merge "use sqla functions from neutron-lib" 2018-07-26 07:52:42 +00:00
dns_db.py Fix all pep8 E129 errors 2018-05-03 13:44:04 +09:00
dvr_mac_db.py use DVRMacAddressNotFound exception from neutron-lib 2018-02-12 12:45:18 -07:00
external_net_db.py use db utils from lib 2018-07-02 08:24:36 -06:00
extradhcpopt_db.py Fix W503 pep8 warnings 2018-04-17 14:22:58 +00:00
extraroute_db.py l3 flavor: more events/notifications and callback priority 2018-05-18 00:14:33 +00:00
flavors_db.py use db utils from lib 2018-07-02 08:24:36 -06:00
ipam_backend_mixin.py Merge "ipam_backend_mixin: Service Type model to OVO" 2018-07-16 11:20:14 +00:00
ipam_pluggable_backend.py Allow setting network-segment on subnet update 2018-05-24 01:09:02 +02:00
l3_agentschedulers_db.py Merge "Update _check_router_retain_needed()" 2018-07-20 05:14:29 +00:00
l3_attrs_db.py l3: don't begin db transaction in set_extra_attr_value 2018-02-07 23:50:47 +00:00
l3_db.py use callback payloads for ROUTER/ROUTER_GATEWAY BEFORE_DELETE events 2018-07-23 14:03:10 -06:00
l3_dvr_db.py use retry_db_errors from neutron-lib 2018-07-16 08:10:54 -06:00
l3_dvr_ha_scheduler_db.py Remove unused LOG 2016-07-05 15:22:13 +08:00
l3_dvrscheduler_db.py Pluralize binding relationship in Port 2018-07-13 19:37:36 -05:00
l3_fip_port_details.py Add port_details to Floating IP 2018-04-25 17:16:03 +00:00
l3_fip_qos.py Refactor duplicated implementation of _get_policy_obj 2018-06-20 09:51:02 +08:00
l3_gwmode_db.py l3 flavor: more events/notifications and callback priority 2018-05-18 00:14:33 +00:00
l3_hamode_db.py use plugin utils from neutron-lib 2018-07-12 08:13:05 -06:00
l3_hascheduler_db.py Fix all pep8 E129 errors 2018-05-03 13:44:04 +09: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 use core resource attribute constants from neutron-lib 2017-06-30 06:25:36 -06: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 db utils from lib 2018-07-02 08:24:36 -06:00
provisioning_blocks.py Make code follow log translation guideline 2017-08-14 02:01:48 +00:00
quota_db.py Create packages for quota modules 2015-07-28 11:55:01 -07:00
rbac_db_mixin.py use db utils from lib 2018-07-02 08:24:36 -06:00
rbac_db_models.py Bump network rev on RBAC change 2017-08-02 16:44:01 +00:00
securitygroups_db.py use db utils from lib 2018-07-02 08:24:36 -06:00
securitygroups_rpc_base.py Fix all pep8 E129 errors 2018-05-03 13:44:04 +09:00
segments_db.py Convert Segment db model to OVO 2018-04-27 15:36:05 +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 Allow sub-resources to have standard attributes 2018-07-04 20:52:37 +00:00
standardattrdescription_db.py Eliminate lookup of "resource extend" funcs by name 2017-04-21 14:48:42 -04:00
subnet_service_type_mixin.py Renamed subnet_service_type_db_models module 2018-04-12 15:41:08 -07:00
tag_db.py Clean up deprecated sqla model import paths 2017-02-25 03:42:34 +00:00
vlantransparent_db.py use vlantransparent api def from neutron-lib 2018-02-20 07:43:03 +00:00