DB Migration 14 fails when applied to running system

Bug #1042925 reported by Brian Waldon on 2012-08-28
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Critical
Brian Waldon

Bug Description

Here's a set of steps to reproduce this issue:

1) Build an Essex deployment of Glance - this will leave the db at version 13
2) Check out the Folsom code
3) Run the Folsom version of glance-manage db_sync - it will attempt to upgrade to 14+

This will result in duplicate table error on 'image_tags'. What's happening is as soon as bin/glance-manage is run, the database models are automatically created. When the migration goes to run, specifically the one that adds the image_tags table, the new table already exists.

This doesn't affect new systems that aren't migrating through version 14

Reviewed: https://review.openstack.org/12090
Committed: http://github.com/openstack/glance/commit/3917fdf3b0c69019303522109d96b9c3d9ff19e2
Submitter: Jenkins
Branch: master

commit 3917fdf3b0c69019303522109d96b9c3d9ff19e2
Author: Brian Waldon <email address hidden>
Date: Tue Aug 28 18:50:06 2012 -0700

    Add missing columns to migration 14

    This adds created_at, updated_at, and deleted_at to database
    migration 14.

    Background Info!

    If a new database is created at version 14, it doesn't run any
    migrations scripts. It lets sqlalchemy create the database from a
    set of sqlalchemy models.

    When an existing database is upgraded to version 14, it will use
    the migration script. What's important to note is that this is
    currently impossible due to bug 1042925.

    While it is typically bad practice to alter a migration script, this
    is a special case as nobody could have used it. What this patch does
    is complete the migration script in preparation for a future patch
    down the road to fix the bug referenced above.

    Fixes bug 1043041

    Change-Id: I6dc2afa735fb2f82df71d58b10c1e1530fce2f89

Changed in glance:
status: In Progress → Fix Committed
Brian Waldon (bcwaldon) on 2012-09-04
Changed in glance:
status: Fix Committed → In Progress

Reviewed: https://review.openstack.org/12071
Committed: http://github.com/openstack/glance/commit/1cfb025d73d3d347e6f6465fcb249c41aef90572
Submitter: Jenkins
Branch: master

commit 1cfb025d73d3d347e6f6465fcb249c41aef90572
Author: Brian Waldon <email address hidden>
Date: Tue Aug 28 13:03:07 2012 -0700

    Remove db auto-creation magic from glance-manage

    This removes the reliance of glance-manage db_sync on configure_db
    calling register_models.

    Fixes bug 1042925

    Change-Id: Id93283905256247bdd2663b799d41a7925804542

Changed in glance:
status: In Progress → Fix Committed
Thierry Carrez (ttx) on 2012-09-11
Changed in glance:
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2012-09-27
Changed in glance:
milestone: folsom-rc1 → 2012.2
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers