[openstack-dev] [nova][heat] sqlalchemy-migrate tool to alembic

Dan Smith dms at danplanet.com
Thu May 21 16:59:31 UTC 2015


> Here's the big thing that you're missing: no data migrations are allowed
> any more in DB migration scripts.

Correct, online-schema-migrations aside, we're trying to avoid ever
doing data migrations in schema migrations anymore.

> In this way, data migrations occur *over time* in the nova.objects
> classes, and the contract phase can be delayed indefinitely until such a
> point that the DBA has determined all data has been properly migrated.

Right. We just pivoted flavors from one place and format to another
place and format in kilo, and we did it without touching any data inside
the schema migration. Flavors get converted over time, but we also
provide a nova-manage command that allows pushing along instances that
aren't being touched. This allows the DBA to make sure that everything
gets migrated online before potentially running the contract phase (if
we had online migrations now). If this flavor thing ended up vacating a
column, we could drop that column in lemming and require all the online
migrations to be performed before we upgrade. That's precisely why we
landed this as our first lemming migration:

https://github.com/openstack/nova/blob/master/nova/db/sqlalchemy/migrate_repo/versions/291_enforce_flavors_migrated.py#L29-34

The flavor thing didn't actually, so we have nothing to drop, but in the
case of another change (like the example earlier in the thread) you do.

--Dan

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20150521/917858eb/attachment.pgp>


More information about the OpenStack-dev mailing list