Migrated issue, originally created by Julien Danjou
Hi Mike,
So a recent commit included in 0.9.0:
https://bitbucket.org/zzzeek/alembic/commits/3f070ea17fa9f5618a299637421d73be6e98d2e5
broke our migration script this way:
alembic.util.exc.CommandError: Migration "stamp_revision -> 1e1a63d3d186" has left an uncommitted transaction opened; transactional_ddl is False so Alembic is not committing transactions
Full log:
http://logs.openstack.org/10/438810/12/check/gate-gnocchi-tox-py27-mysql-ubuntu-xenial/4f5b49d/console.html#_2017-02-28_18_30_27_537440
The code is stamping with "head" (that's 1e1a63d3d186). To do so it uses this migration code in env.py:
https://github.com/openstack/gnocchi/blob/master/gnocchi/indexer/alembic/env.py#L59-L80
and the problem is that since the migrations are run in a global transaction, that does not work anymore. Removing the transaction here makes the migration unsafe for an online migration AFAICT.
So… I understand why the check is there but I'm not sure whetever we need to fix our code or if the check is too aggressive or in the wrong place, or if it's a corner case. Hint appreciated. :)
Migrated issue, originally created by Julien Danjou
Hi Mike,
So a recent commit included in 0.9.0:
https://bitbucket.org/zzzeek/alembic/commits/3f070ea17fa9f5618a299637421d73be6e98d2e5
broke our migration script this way:
alembic.util.exc.CommandError: Migration "stamp_revision -> 1e1a63d3d186" has left an uncommitted transaction opened; transactional_ddl is False so Alembic is not committing transactions
Full log:
http://logs.openstack.org/10/438810/12/check/gate-gnocchi-tox-py27-mysql-ubuntu-xenial/4f5b49d/console.html#_2017-02-28_18_30_27_537440
The code is stamping with "head" (that's 1e1a63d3d186). To do so it uses this migration code in env.py:
https://github.com/openstack/gnocchi/blob/master/gnocchi/indexer/alembic/env.py#L59-L80
and the problem is that since the migrations are run in a global transaction, that does not work anymore. Removing the transaction here makes the migration unsafe for an online migration AFAICT.
So… I understand why the check is there but I'm not sure whetever we need to fix our code or if the check is too aggressive or in the wrong place, or if it's a corner case. Hint appreciated. :)