neutron/neutron/tests
Kailun Qin 6295207e22 Block port update from unbound DHCP agent
Current DHCP port management in Neutron makes the server to clear the
device_id while the agent is responsible for setting it.

This may cause a potential race condition, for example during network
rescheduling. The server aims to clear the device_id on a DHCP port and
assign the network to another agent while the old agent might just be
taking possession of the port. If the DHCP agent takes possession of the
port (i.e., update port...set the device_id) before the server clears
it, then there is no issue. However, if this happens after the clear
operation by server then the DHCP port would be updated/marked to be
owned by the old agent.

When the new agent takes over the network scheduled to it, it won't be
able to find a port to reuse so that an extra port might need to be
created. This leads to two issues:
1) an extra port is created and never deleted;
2) the extra port creation may fail if there are no available IP
addresses.

This patch proposes a validation check to prevent an agent from updating
a DHCP port unless the network is bound to that agent.

Co-authored-by: Allain Legacy <Allain.legacy@windriver.com>

Closes-Bug: #1795126
Story: 2003919
Change-Id: Ie619516c07fb3dc9d025f64c0e1e59d5d808cb6f
(cherry picked from commit b70ee4df88)
(cherry picked from commit b9f9c021c9)
2019-02-05 15:24:55 +00:00
..
common Avoid agents adding ports as trunk by default. 2018-06-21 17:06:48 +00:00
contrib Use older keepalived version in functional tests 2018-08-25 20:58:10 +00:00
etc Remove FWaaS policy.json entries 2016-09-06 21:30:41 +00:00
fullstack [Fullstack] HA L3 agent restart only standby agents 2018-07-16 13:30:52 +02:00
functional Merge "OpenFlowSwitchMixin: do not override delete_flows" into stable/ocata 2018-10-31 15:05:23 +00:00
retargetable Adopt neutron-lib plugin directory 2016-11-23 04:45:33 -07:00
tempest Fix bash cmd used in scenario trunk tests 2018-10-17 08:45:08 +02:00
unit Block port update from unbound DHCP agent 2019-02-05 15:24:55 +00:00
var
__init__.py Avoid eventlet monkey patching for the tempest plugin 2016-04-29 22:47:24 -05:00
base.py [Functional] Increase test_timeout for db migration tests 2018-10-17 15:24:02 +00:00
fake_notifier.py
post_mortem_debug.py
tools.py Display deprecation warning in test only once 2017-01-29 09:44:03 +00:00