From 813a3a30dedb0a0bf003d1f3d4e06c26b9cb709e Mon Sep 17 00:00:00 2001 From: Matt Dietz Date: Sat, 20 Jun 2015 21:49:43 -0500 Subject: [PATCH] Synchronize changes with perf testing NCP-1564 * Adds a new index for quark_ip_addresses that helps with reallocation * Removes the semaphore decorator from select_subnet --- .../alembic/versions/29265c7bcd1f_.py | 26 +++++++++++++++++++ quark/db/migration/alembic/versions/HEAD | 2 +- quark/ipam.py | 4 --- 3 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 quark/db/migration/alembic/versions/29265c7bcd1f_.py diff --git a/quark/db/migration/alembic/versions/29265c7bcd1f_.py b/quark/db/migration/alembic/versions/29265c7bcd1f_.py new file mode 100644 index 0000000..0e3f1fe --- /dev/null +++ b/quark/db/migration/alembic/versions/29265c7bcd1f_.py @@ -0,0 +1,26 @@ +"""empty message + +Revision ID: 29265c7bcd1f +Revises: 4dbf83f37bc0 +Create Date: 2015-06-18 14:27:18.571918 + +""" + +# revision identifiers, used by Alembic. +revision = '29265c7bcd1f' +down_revision = '4dbf83f37bc0' + +from alembic import op + + +def upgrade(): + op.create_index(op.f('ix_quark_reallocate_ip_addresses'), + 'quark_ip_addresses', + ["network_id", "tenant_id", "version", "subnet_id", + "deallocated_at"], + unique=False) + + +def downgrade(): + op.drop_index(op.f('ix_quark_reallocate_ip_addresses'), + table_name='quark_ip_addresses') diff --git a/quark/db/migration/alembic/versions/HEAD b/quark/db/migration/alembic/versions/HEAD index f6b02a7..6aa515c 100644 --- a/quark/db/migration/alembic/versions/HEAD +++ b/quark/db/migration/alembic/versions/HEAD @@ -1 +1 @@ -4dbf83f37bc0 +29265c7bcd1f \ No newline at end of file diff --git a/quark/ipam.py b/quark/ipam.py index 00b9428..71838ac 100644 --- a/quark/ipam.py +++ b/quark/ipam.py @@ -816,10 +816,6 @@ class QuarkIpam(object): return False return True - # RM6180(roaet): - # - removed session.begin due to deadlocks - # - fix off-by-one error and overflow - @synchronized(named("select_subnet")) def select_subnet(self, context, net_id, ip_address, segment_id, subnet_ids=None, **filters): LOG.info("Selecting subnet(s) - (Step 2 of 3) [{0}]".format(