Skip to content

New transaction checks error when stamping #417

@sqlalchemy-bot

Description

@sqlalchemy-bot

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. :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions