]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
ML2: Bind ports outside transactions
authorRobert Kukura <kukura@noironetworks.com>
Wed, 12 Mar 2014 01:54:35 +0000 (21:54 -0400)
committerRobert Kukura <kukura@noironetworks.com>
Mon, 14 Jul 2014 19:13:52 +0000 (15:13 -0400)
commitb1677dcb80ce8b83aadb2180efad3527a96bd3bc
treefb1dceb27a139eacd790def02c87ef758b0b4b00
parent59da928e945ec58836d34fd561d30a8a446e2728
ML2: Bind ports outside transactions

The ML2 plugin now calls the bind_port() operation on the registered
mechanism drivers outside of any enclosing DB transaction. Ports are
created or updated in one transaction, then a binding is established
if possible, and finally a second transaction commits the binding
result.

With [re]binding moved outside the DB transaction that triggered it,
it is now possible that multiple threads or processes will
concurrently try to bind the same port, or that the port will be
updated between transactions. Concurrent attempts to bind the same
port are allowed to proceed, which results are used is resolved in the
second transaction, and binding is retried if necessary.

Improvements to the Cisco Nexus driver and unit tests from Rich Curran
needed due to the binding changes are also included.

Closes-Bug: 1276391
Closes-Bug: 1335226
Change-Id: I65dafc330d6e812dad0667d2383858504d0ba299
12 files changed:
neutron/plugins/ml2/db.py
neutron/plugins/ml2/driver_api.py
neutron/plugins/ml2/driver_context.py
neutron/plugins/ml2/drivers/mech_agent.py
neutron/plugins/ml2/drivers/mech_bigswitch/driver.py
neutron/plugins/ml2/managers.py
neutron/plugins/ml2/plugin.py
neutron/plugins/ml2/rpc.py
neutron/tests/unit/ml2/drivers/cisco/nexus/test_cisco_mech.py
neutron/tests/unit/ml2/drivers/cisco/nexus/test_cisco_nexus.py
neutron/tests/unit/ml2/drivers/mechanism_test.py
neutron/tests/unit/ml2/drivers/test_bigswitch_mech.py