db_sync downgrade from 44 to 43 fails

Bug #1405673 reported by Boris Bobrov on 2014-12-25
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Low
Boris Bobrov

Bug Description

(.venv)breton@bbobrov-pc ~/src/keystone (master*) $ keystone-manage db_sync 44
(.venv)breton@bbobrov-pc ~/src/keystone (master*) $ keystone-manage db_sync 43
2014-12-25 22:18:38.190 31044 CRITICAL keystone [-] NoSuchTableError: orig_service
2014-12-25 22:18:38.190 31044 TRACE keystone Traceback (most recent call last):
2014-12-25 22:18:38.190 31044 TRACE keystone File "/home/breton/src/keystone/.venv/bin/keystone-manage", line 6, in <module>
2014-12-25 22:18:38.190 31044 TRACE keystone exec(compile(open(__file__).read(), __file__, 'exec'))
2014-12-25 22:18:38.190 31044 TRACE keystone File "/home/breton/src/keystone/bin/keystone-manage", line 44, in <module>
2014-12-25 22:18:38.190 31044 TRACE keystone cli.main(argv=sys.argv, config_files=config_files)
2014-12-25 22:18:38.190 31044 TRACE keystone File "/home/breton/src/keystone/keystone/cli.py", line 311, in main
2014-12-25 22:18:38.190 31044 TRACE keystone CONF.command.cmd_class.main()
2014-12-25 22:18:38.190 31044 TRACE keystone File "/home/breton/src/keystone/keystone/cli.py", line 74, in main
2014-12-25 22:18:38.190 31044 TRACE keystone migration_helpers.sync_database_to_version(extension, version)
2014-12-25 22:18:38.190 31044 TRACE keystone File "/home/breton/src/keystone/keystone/common/sql/migration_helpers.py", line 204, in sync_database_to_version
2014-12-25 22:18:38.190 31044 TRACE keystone _sync_common_repo(version)
2014-12-25 22:18:38.190 31044 TRACE keystone File "/home/breton/src/keystone/keystone/common/sql/migration_helpers.py", line 160, in _sync_common_repo
2014-12-25 22:18:38.190 31044 TRACE keystone init_version=init_version)
2014-12-25 22:18:38.190 31044 TRACE keystone File "/home/breton/src/keystone/.venv/local/lib/python2.7/site-packages/oslo/db/sqlalchemy/migration.py", line 82, in db_sync
2014-12-25 22:18:38.190 31044 TRACE keystone version)
2014-12-25 22:18:38.190 31044 TRACE keystone File "/home/breton/src/keystone/.venv/local/lib/python2.7/site-packages/migrate/versioning/api.py", line 202, in downgrade
2014-12-25 22:18:38.190 31044 TRACE keystone return _migrate(url, repository, version, upgrade=False, err=err, **opts)
2014-12-25 22:18:38.190 31044 TRACE keystone File "<string>", line 2, in _migrate
2014-12-25 22:18:38.190 31044 TRACE keystone File "/home/breton/src/keystone/.venv/local/lib/python2.7/site-packages/migrate/versioning/util/__init__.py", line 160, in with_engine
2014-12-25 22:18:38.190 31044 TRACE keystone return f(*a, **kw)
2014-12-25 22:18:38.190 31044 TRACE keystone File "/home/breton/src/keystone/.venv/local/lib/python2.7/site-packages/migrate/versioning/api.py", line 366, in _migrate
2014-12-25 22:18:38.190 31044 TRACE keystone schema.runchange(ver, change, changeset.step)
2014-12-25 22:18:38.190 31044 TRACE keystone File "/home/breton/src/keystone/.venv/local/lib/python2.7/site-packages/migrate/versioning/schema.py", line 93, in runchange
2014-12-25 22:18:38.190 31044 TRACE keystone change.run(self.engine, step)
2014-12-25 22:18:38.190 31044 TRACE keystone File "/home/breton/src/keystone/.venv/local/lib/python2.7/site-packages/migrate/versioning/script/py.py", line 148, in run
2014-12-25 22:18:38.190 31044 TRACE keystone script_func(engine)
2014-12-25 22:18:38.190 31044 TRACE keystone File "/home/breton/src/keystone/keystone/common/sql/migrate_repo/versions/044_service_enabled.py", line 143, in downgrade
2014-12-25 22:18:38.190 31044 TRACE keystone _downgrade_service_table_with_copy(meta, migrate_engine)
2014-12-25 22:18:38.190 31044 TRACE keystone File "/home/breton/src/keystone/keystone/common/sql/migrate_repo/versions/044_service_enabled.py", line 120, in _downgrade_service_table_with_copy
2014-12-25 22:18:38.190 31044 TRACE keystone orig_service_table = sql.Table('orig_service', meta, autoload=True)
2014-12-25 22:18:38.190 31044 TRACE keystone File "/home/breton/src/keystone/.venv/local/lib/python2.7/site-packages/sqlalchemy/sql/schema.py", line 406, in __new__
2014-12-25 22:18:38.190 31044 TRACE keystone table._init(name, metadata, *args, **kw)
2014-12-25 22:18:38.190 31044 TRACE keystone File "/home/breton/src/keystone/.venv/local/lib/python2.7/site-packages/sqlalchemy/sql/schema.py", line 479, in _init
2014-12-25 22:18:38.190 31044 TRACE keystone self._autoload(metadata, autoload_with, include_columns)
2014-12-25 22:18:38.190 31044 TRACE keystone File "/home/breton/src/keystone/.venv/local/lib/python2.7/site-packages/sqlalchemy/sql/schema.py", line 503, in _autoload
2014-12-25 22:18:38.190 31044 TRACE keystone self, include_columns, exclude_columns
2014-12-25 22:18:38.190 31044 TRACE keystone File "/home/breton/src/keystone/.venv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1732, in run_callable
2014-12-25 22:18:38.190 31044 TRACE keystone return conn.run_callable(callable_, *args, **kwargs)
2014-12-25 22:18:38.190 31044 TRACE keystone File "/home/breton/src/keystone/.venv/local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1241, in run_callable
2014-12-25 22:18:38.190 31044 TRACE keystone return callable_(self, *args, **kwargs)
2014-12-25 22:18:38.190 31044 TRACE keystone File "/home/breton/src/keystone/.venv/local/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 356, in reflecttable
2014-12-25 22:18:38.190 31044 TRACE keystone return insp.reflecttable(table, include_columns, exclude_columns)
2014-12-25 22:18:38.190 31044 TRACE keystone File "/home/breton/src/keystone/.venv/local/lib/python2.7/site-packages/sqlalchemy/engine/reflection.py", line 515, in reflecttable
2014-12-25 22:18:38.190 31044 TRACE keystone raise exc.NoSuchTableError(table.name)
2014-12-25 22:18:38.190 31044 TRACE keystone NoSuchTableError: orig_service
2014-12-25 22:18:38.190 31044 TRACE keystone

Boris Bobrov (bbobrov) on 2014-12-26
summary: - db_sync from version 44 to 43 fails
+ db_sync downgrade fails for some revisions
description: updated
summary: - db_sync downgrade fails for some revisions
+ db_sync downgrade from 44 to 43 fails
description: updated

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

Changed in keystone:
assignee: nobody → Boris Bobrov (bbobrov)
status: New → In Progress

Reviewed: https://review.openstack.org/144321
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=fe297b578a9a0cf1daeb4ea7c9ada4a193f7e0c3
Submitter: Jenkins
Branch: master

commit fe297b578a9a0cf1daeb4ea7c9ada4a193f7e0c3
Author: Boris Bobrov <email address hidden>
Date: Mon Dec 29 18:17:32 2014 +0300

    Fix transaction issue in migration 44 downgrade

    The downgrade failed due to mixing of transactional and
    non-transactional operations. The fix separates them.

    Change-Id: I0fad03e83d460282326e38c7e097c1065a84fabd
    Closes-bug: 1405673
    Partial-bug: 1406315

Changed in keystone:
status: In Progress → Fix Committed
Changed in keystone:
importance: Undecided → Low
milestone: none → kilo-2
Thierry Carrez (ttx) on 2015-02-05
Changed in keystone:
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2015-04-30
Changed in keystone:
milestone: kilo-2 → 2015.1.0
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers