Migration 209 fails to remove missing foreign keys when null values exist

Bug #1240325 reported by Joshua Hesketh
6
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.

Tags: db
Changed in nova:
assignee: nobody → Joshua Hesketh (joshua.hesketh)
David Ripton (dripton)
Changed in nova:
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/52000
Committed: http://github.com/openstack/nova/commit/6eda819ca12f7f58e41fe9496f1ec1f2f471f6b5
Submitter: Jenkins
Branch: master

commit 6eda819ca12f7f58e41fe9496f1ec1f2f471f6b5
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: Id0f8c8cb082df8861e85f925b979ddd934a95bfc
    Closes-Bug: 1240325

Changed in nova:
status: Confirmed → Fix Committed
Changed in nova:
milestone: none → icehouse-1
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: icehouse-1 → 2014.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.