]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Ensure non-overlapping cidrs in subnetpools with galera
authorCedric Brandily <zzelle@gmail.com>
Thu, 28 May 2015 16:35:17 +0000 (18:35 +0200)
committerCedric Brandily <zzelle@gmail.com>
Fri, 31 Jul 2015 09:33:52 +0000 (09:33 +0000)
commit03b70b109449f3b9329834c7aa88fd26ed71cf26
tree4a6e1c2da7168c2267b6883d15a95dcfd8512dc9
parent53bc7162e1b049f3dba6321d60c541a4d1e9345d
Ensure non-overlapping cidrs in subnetpools with galera

This change enables galera support in _lock_subnetpool[1]. It uses an
update to disallow 2 transactions performing concurrent subnet
allocation in the same subnetpool to succeed: the 2 transactions will
conflict because they update the same row so the db (including Galera
multi-writer cluster) will discard the last transaction and
Controller.create[2] will catch and retry the "discarded" allocation.

This change adds the "hash" attribute in "subnetpools" table to enable
previous update.

[1] neutron.ipam.subnet_alloc.SubnetAllocator
[2] neutron.api.v2.base

Change-Id: I74f7100a6fd9b7787be693adffec15ec468d0018
Closes-Bug: #1451576
neutron/db/migration/alembic_migrations/versions/HEADS
neutron/db/migration/alembic_migrations/versions/liberty/expand/26c371498592_subnetpool_hash.py [new file with mode: 0644]
neutron/db/models_v2.py
neutron/ipam/subnet_alloc.py