]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Fix DB integrity issues when using postgres
authorarmando-migliaccio <amigliaccio@nicira.com>
Thu, 31 Oct 2013 23:53:31 +0000 (16:53 -0700)
committerarmando-migliaccio <amigliaccio@nicira.com>
Thu, 14 Nov 2013 16:14:31 +0000 (08:14 -0800)
commit54d79acaab50993f08b50f21019f82f17d38caa3
treedc9a675e3645e7e778320e1939ce55b67d2f7360
parent3c3e6eef90c87440c87803dba3325e7cc8c79a17
Fix DB integrity issues when using postgres

The IntegrityError faced on network deletion that
spooks Tempest tests is most likely caused by the
fact that the ml2 plugin does a dirty read. By
adding a 'select for update' we should be able to
address the issue once and for all.

Also, there's a chance that the dhcp port gets
reallocated while we are deleting the network. To
this aim, catch the integrity error and attempt
to recover from it.

This patch also removes the handling of errors
on concurrent reads that can no longer occur when
deleting the network.

(Hopefully) Closes-bug: #1239637

PS: This fix may be relevant for bugs #1243726 and #1246737

Change-Id: Iefae7fc8a903cc35d8bf80fc4cee533b7f64032c
neutron/db/db_base_plugin_v2.py
neutron/plugins/ml2/plugin.py