]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Remove SELECT FOR UPDATE use in ML2 tunnel driver add_endpoint
authorCedric Brandily <zzelle@gmail.com>
Mon, 7 Jul 2014 22:05:21 +0000 (00:05 +0200)
committerCedric Brandily <zzelle@gmail.com>
Wed, 13 Aug 2014 14:50:13 +0000 (16:50 +0200)
commitbc4965080ce83db50b71255d6a0f972b9be67b1b
tree53e746292f055a95d2d2a9d52b2daa279e24d560
parent76dd028cdd382099a7e809a86d56970faaa71b55
Remove SELECT FOR UPDATE use in ML2 tunnel driver add_endpoint

SELECT FOR UPDATE expression, which is triggered with the use of the
SQLAlchemy Query object's with_lockmode('update') method, is
detrimental to performance and scalability of the database
performance code in Neutron due to the lock contention it produces.

SELECT FOR UPDATE can be entirely avoided in add_endpoint methods
with the use of single-shot SELECT and INSERT expressions and the
correction of VxlanEndpoint primary key: indeed previously it was not
possible to create multiple endpoints with the same ip, now the model
primary key constraint ensures it.

Change-Id: Id69fbc15c8f51b4b275cd742312e6ff6802d8c0f
Partial-Bug: #1330562
neutron/db/migration/alembic_migrations/versions/4eba2f05c2f4_correct_vxlan_endpoint_primary_key.py [new file with mode: 0644]
neutron/db/migration/alembic_migrations/versions/HEAD
neutron/plugins/ml2/drivers/type_gre.py
neutron/plugins/ml2/drivers/type_vxlan.py
neutron/tests/unit/ml2/test_type_gre.py
neutron/tests/unit/ml2/test_type_vxlan.py