]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Avoid long transaction in plugin.delete_ports()
authorAkihiro Motoki <motoki@da.jp.nec.com>
Fri, 7 Mar 2014 06:58:46 +0000 (15:58 +0900)
committerAkihiro Motoki <motoki@da.jp.nec.com>
Sat, 15 Mar 2014 15:19:51 +0000 (00:19 +0900)
commit5e4b0c6fc6670ea036d801ce53444272bc311929
treed1de2daa0c0dcbffeafe30bc353fd6f8445890d6
parentb76c9e888824ec0c6a42a5a01e1d5022f1eb02b9
Avoid long transaction in plugin.delete_ports()

db_plugin.delete_ports() called plugin.delete_port() under
a transaction. It leads to long transaction if plugin.delete_port
talks with external systems. This commit changes each delete_port
outside of a transaction to avoid longer transaction.

plugin.delete_ports is now called by release_dhcp_ports and
dhcp-agent ports can be deleted separately, so this changes
does not break the existing behavior.

delete_ports is renamed to delete_ports_by_device_id
to clarify the usage of this method.

NEC plugin already has this change and it is no longer needed.

_do_side_effect helper method in test_db_plugin is renamed
to more self-descriptive name.

Change-Id: Ied5883a57c7774c3b0778453d84c717b337f88c0
Closes-Bug: #1282925
Related-Bug: #1283522
neutron/db/db_base_plugin_v2.py
neutron/db/dhcp_rpc_base.py
neutron/plugins/nec/nec_plugin.py
neutron/tests/unit/cisco/test_network_plugin.py
neutron/tests/unit/nec/test_nec_plugin.py
neutron/tests/unit/test_db_plugin.py
neutron/tests/unit/test_db_rpc_base.py