]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Race condition of L3-agent to add/remove routers
authorLi Ma <skywalker.nick@gmail.com>
Fri, 21 Feb 2014 08:57:25 +0000 (00:57 -0800)
committerLi Ma <skywalker.nick@gmail.com>
Tue, 29 Jul 2014 08:52:18 +0000 (01:52 -0700)
commitfbc6b991a79a147bf1411b643f5c304062e5956a
tree1d8cadb8c435581201e29be93cdc57187afb3c18
parent30556c4a234406754de86ec7e5e4c6b7dc3fdc44
Race condition of L3-agent to add/remove routers

This race condition happens when repeatedly calling
l3-agent-router-add and l3-agent-router-remove
by different neutron-servers at the same time.

The primary key constraint is added for the pair of
(router_id and l3_agent_id).

During migration, verification is done if the current
records violate the PK constraint defined in this bug
fix, and sanitize the data before schema modification.

Due to different dialects of database engines, different
sql statements are executed correspondingly to do
the verification.

Change-Id: Ia541e023b757b2e77c4eec9bb1670632c7a271fa
Closes-Bug: #1230323
neutron/db/l3_agentschedulers_db.py
neutron/db/migration/alembic_migrations/versions/31d7f831a591_add_constraint_for_routerid.py [new file with mode: 0644]
neutron/db/migration/alembic_migrations/versions/HEAD
neutron/scheduler/l3_agent_scheduler.py
neutron/tests/unit/test_l3_schedulers.py