Rolling upgrades: online schema migration

Bug #1505974 reported by Grzegorz Grasza
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Medium
Grzegorz Grasza

Bug Description

Future incompatible changes in sqlalchemy models, like removing, renaming columns and tables can break rolling upgrades (upgrades when Heat services are run at different versions simultaneously).

Because Heat plans to use Alembic for SQL database migrations, "online schema migrations" could be implemented as in Neutron: http://specs.openstack.org/openstack/neutron-specs/specs/liberty/online-schema-migrations.html

The spec is long, but the zest of it is to organize schema migrations scripts into "expand" and "contract" phases that are also linked to major release versions in a backwards compatible way. The "expand" phase is run before the upgrade, and the "contract" phase
can be executed after all the services are running with the new version.

In the meantime, to address this, we can also ban schema changes which cause incompatibilities specifically drops and alters, like in Nova:

https://github.com/openstack/nova/blob/stable/liberty/nova/tests/unit/db/test_migrations.py#L224-L225

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

Fix proposed to branch: master
Review: https://review.openstack.org/234686

Changed in heat:
assignee: nobody → Grzegorz Grasza (xek)
status: New → In Progress
Changed in heat:
milestone: none → mitaka-1
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/234686
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=2ce5f085bd84a50ee1892066ccfbdba3d2057ae6
Submitter: Jenkins
Branch: master

commit 2ce5f085bd84a50ee1892066ccfbdba3d2057ae6
Author: Grzegorz Grasza <email address hidden>
Date: Wed Oct 14 11:37:33 2015 +0200

    Unit test for checking that migrations don't cause downtime

    Future incompatible changes in sqlalchemy models, like removing,
    renaming columns and tables can break rolling upgrades (upgrades when
    Heat services are run at different versions simultaneously). This
    patch bans chema changes which cause incompatibilities - specifically
    drops and alters.

    After this test is merged, we can be sure that schema migrations can
    be done online, allowing for rolling upgrades.

    Change-Id: I2722577a2316d76017a0769a435e816a499c84b3
    Closes-Bug: #1505974

Changed in heat:
status: In Progress → Fix Committed
Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/heat 6.0.0.0b1

This issue was fixed in the openstack/heat 6.0.0.0b1 development milestone.

Changed in heat:
status: Fix Committed → Fix Released
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.