Migration 209 fails to remove missing foreign keys when null values exist
Bug #1240325 reported by
Joshua Hesketh
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Low
|
Joshua Hesketh |
Bug Description
Migration 209 failed to re-apply with MySQL/Postgres due to existing data violating foreign keys. The migration takes a backup of these rows and removes them before applying the new fkeys but the backup fails when there are NULL instance UUID's (due to the behavior of "NOT IN").
When snake-walking down the migrations a migration version test inserts instances with NULL UUID's which exposes this error.
Changed in nova: | |
assignee: | nobody → Joshua Hesketh (joshua.hesketh) |
Changed in nova: | |
importance: | Undecided → Low |
status: | New → Confirmed |
Changed in nova: | |
milestone: | none → icehouse-1 |
Changed in nova: | |
status: | Fix Committed → Fix Released |
Changed in nova: | |
milestone: | icehouse-1 → 2014.1 |
To post a comment you must log in.
Reviewed: https:/ /review. openstack. org/52000 github. com/openstack/ nova/commit/ 6eda819ca12f7f5 8e41fe9496f1ec1 f2f471f6b5
Committed: http://
Submitter: Jenkins
Branch: master
commit 6eda819ca12f7f5 8e41fe9496f1ec1 f2f471f6b5
Author: Joshua Hesketh <email address hidden>
Date: Wed Oct 16 15:03:13 2013 +1100
Ensure migration 209 works with NULL fkey values
Modify the sub-query on migration 209's backup to not select NULL
items which cause the NOT IN to always be false and consequently
the backup not to run resulting in a violation of the foreign keys.
To test, add an instance with NULL uuid to check the backups still
work correctly and avoid violating the foreign key constraint.
If there are NULL values in a NOT IN () set the result is always
false. Therefore having this instance inserted causes migration 209
to fail unless the IN set sub-query is modified appropriately.
Change-Id: Id0f8c8cb082df8 861e85f925b979d dd934a95bfc
Closes-Bug: 1240325