neutron/neutron/cmd
Sebastian Lohff b993ebb407 Fix dynamic segment allocation race condition
When two segments are concurrently created this could have resulted in
both threads creating a segment, thus resulting in two segments with
different segmentation ids. To prevent this we now introduce a new
unique constraint onto the networksegments table, which requires
(network_id, network_type, physical_network) to be unique, which allows
only a single segment with a single segmentation id to exist per
combination of these three values.

With the constraint in place a DB error will be thrown, which will cause
allocate_dynamic_segment() to be executed again and this time it will
find the already existing segment. To make sure that no additional DB
objects are created when segment creation failed we need to put all of
the allocation code into a DB transaction.

Change-Id: I407ae88d69ed971bf8d9a9b79120366f33bb56fd
Closes-Bug: #1791233
2021-10-07 13:20:04 +02:00
..
eventlet Set process name for agents 2020-07-01 12:28:29 +02:00
ovn Add wait for the post-fork event to nb/sb objects 2021-07-13 09:23:14 -05:00
sanity Migrate "ovs-ofctl" to oslo.privsep 2021-03-31 16:44:30 +00:00
upgrade_checks Fix dynamic segment allocation race condition 2021-10-07 13:20:04 +02:00
__init__.py Fix logging error for Guru Meditation Report 2016-02-08 16:52:17 -08:00
destroy_patch_ports.py Add script which can clean patch ports between bridges 2020-12-10 10:08:02 +00:00
ipset_cleanup.py Initialize privsep library in Neutron commands 2021-04-14 16:38:44 +00:00
keepalived_state_change.py Replace keepalived notifier bash script with Python ip monitor 2015-03-18 18:59:33 -04:00
linuxbridge_cleanup.py Switch IPDevice.exists() method to use pyroute2 2018-03-19 11:56:45 +01:00
netns_cleanup.py Migrate "netstat" to oslo.privsep 2020-06-19 14:59:11 +00:00
ovs_cleanup.py Initialize privsep library for neutron-ovs-cleanup 2021-04-14 11:48:01 -04:00
pd_notify.py Fix pylint R1714 (consider-using-in) refactor messages 2019-02-21 21:11:34 +00:00
runtime_checks.py Import packaging.version explicitly 2020-11-19 10:17:24 +00:00
sanitize_port_mac_addresses.py Sanitize MAC addresses 2021-07-08 16:46:55 +00:00
sanity_check.py Added common config and SR-IOV agent config to sanity check 2021-04-27 15:05:00 +00:00
status.py Add check for external_network_bridge in neutron-status 2019-03-22 13:14:24 +00:00