b993ebb407
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 |
||
---|---|---|
.. | ||
__init__.py | ||
test_base_scheduler.py | ||
test_dhcp_agent_scheduler.py | ||
test_l3_agent_scheduler.py | ||
test_l3_ovn_scheduler.py |