vpnaas alembic migration fails for upgrade liberty

Bug #1550434 reported by Henry Gessau
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Critical
Henry Gessau

Bug Description

With the mitaka version of neutron and vpnaas installed:

$ NDBM --subproject neutron-vpnaas upgrade liberty
No handlers could be found for logger "oslo_config.cfg"
INFO [alembic.runtime.migration] Context impl MySQLImpl.
INFO [alembic.runtime.migration] Will assume non-transactional DDL.
  Running upgrade (contract) for neutron-vpnaas ...
INFO [alembic.runtime.migration] Context impl MySQLImpl.
INFO [alembic.runtime.migration] Will assume non-transactional DDL.
INFO [alembic.runtime.migration] Running upgrade -> start_neutron_vpnaas, start neutron-vpnaas chain
INFO [alembic.runtime.migration] Running upgrade start_neutron_vpnaas -> 3ea02b2a773e, add_index_tenant_id
INFO [alembic.runtime.migration] Running upgrade 3ea02b2a773e -> kilo, kilo
INFO [alembic.runtime.migration] Running upgrade kilo -> 30018084ed99, Initial no-op Liberty expand rule.
INFO [alembic.runtime.migration] Running upgrade 30018084ed99 -> 24f28869838b, Add fields to VPN service table
INFO [alembic.runtime.migration] Running upgrade kilo -> 56893333aa52, fix identifier map fk
INFO [alembic.runtime.migration] Running upgrade 56893333aa52, 24f28869838b -> 333dfd6afaa2, Populate VPN service table fields
INFO [alembic.runtime.migration] Running upgrade 333dfd6afaa2 -> 2c82e782d734, drop_tenant_id_in_cisco_csr_identifier_map
  OK
INFO [alembic.runtime.migration] Context impl MySQLImpl.
INFO [alembic.runtime.migration] Will assume non-transactional DDL.
Traceback (most recent call last):
  File "/home/henry/Dev/neutron-vpnaas/.tox/pep8/bin/neutron-db-manage", line 10, in <module>
    sys.exit(main())
  File "/home/henry/Dev/neutron-vpnaas/.tox/pep8/src/neutron/neutron/db/migration/cli.py", line 744, in main
    return_val |= bool(CONF.command.func(config, CONF.command.name))
  File "/home/henry/Dev/neutron-vpnaas/.tox/pep8/src/neutron/neutron/db/migration/cli.py", line 218, in do_upgrade
    run_sanity_checks(config, revision)
  File "/home/henry/Dev/neutron-vpnaas/.tox/pep8/src/neutron/neutron/db/migration/cli.py", line 726, in run_sanity_checks
    script_dir.run_env()
  File "/home/henry/Dev/neutron-vpnaas/.tox/pep8/local/lib/python2.7/site-packages/alembic/script/base.py", line 397, in run_env
    util.load_python_file(self.dir, 'env.py')
  File "/home/henry/Dev/neutron-vpnaas/.tox/pep8/local/lib/python2.7/site-packages/alembic/util/pyfiles.py", line 81, in load_python_file
    module = load_module_py(module_id, path)
  File "/home/henry/Dev/neutron-vpnaas/.tox/pep8/local/lib/python2.7/site-packages/alembic/util/compat.py", line 79, in load_module_py
    mod = imp.load_source(module_id, path, fp)
  File "/home/henry/Dev/neutron-vpnaas/neutron_vpnaas/db/migration/alembic_migrations/env.py", line 87, in <module>
    run_migrations_online()
  File "/home/henry/Dev/neutron-vpnaas/neutron_vpnaas/db/migration/alembic_migrations/env.py", line 78, in run_migrations_online
    context.run_migrations()
  File "<string>", line 8, in run_migrations
  File "/home/henry/Dev/neutron-vpnaas/.tox/pep8/local/lib/python2.7/site-packages/alembic/runtime/environment.py", line 797, in run_migrations
    self.get_context().run_migrations(**kw)
  File "/home/henry/Dev/neutron-vpnaas/.tox/pep8/local/lib/python2.7/site-packages/alembic/runtime/migration.py", line 303, in run_migrations
    for step in self._migrations_fn(heads, self):
  File "/home/henry/Dev/neutron-vpnaas/.tox/pep8/src/neutron/neutron/db/migration/cli.py", line 717, in check_sanity
    revision, rev, implicit_base=True):
  File "/home/henry/Dev/neutron-vpnaas/.tox/pep8/local/lib/python2.7/site-packages/alembic/script/revision.py", line 664, in _iterate_revisions
    raise RangeNotAncestorError(lower, upper)
alembic.script.revision.RangeNotAncestorError: Revision (u'2c82e782d734',) is not an ancestor of revision 24f28869838b

Revision history for this message
Henry Gessau (gessau) wrote :

Note: if liberty is installed, upgrade heads succeeds. Then install mitaka and upgrade heads succeeds. So marking this as low priority for now.

tags: added: db vpnaas
Changed in neutron:
importance: Undecided → Low
Revision history for this message
Henry Gessau (gessau) wrote :

Problem is that when upgrading to a milestone then neutron-db-manage is not doing the expand branch before the contract branch.

Changed in neutron:
status: New → In Progress
importance: Low → Critical
assignee: nobody → Henry Gessau (gessau)
tags: removed: vpnaas
Henry Gessau (gessau)
Changed in neutron:
milestone: none → mitaka-rc1
tags: added: liberty-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

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

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

Reviewed: https://review.openstack.org/288253
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=1c67cda0f8ce5b6ff028d53cedbb792931fd96f6
Submitter: Jenkins
Branch: master

commit 1c67cda0f8ce5b6ff028d53cedbb792931fd96f6
Author: Henry Gessau <email address hidden>
Date: Fri Mar 4 00:39:53 2016 -0500

    Fix branch order when upgrading to alembic milestone

    When using neutron-db-manage to upgrade to a milestone tag,
    the script was not ensuring that the expand branch was
    upgraded before the contract branch. This broke projects
    where contract migrations depend on expand migrations.

    Fixes-Bug: #1550434

    Change-Id: I0e6fc31dfa062c689936b2fe982147335ad9dce3

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/liberty)

Fix proposed to branch: stable/liberty
Review: https://review.openstack.org/296485

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/liberty)

Reviewed: https://review.openstack.org/296485
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=5dd0a912f112a1d50c31af120b0e8ccb5d80ca66
Submitter: Jenkins
Branch: stable/liberty

commit 5dd0a912f112a1d50c31af120b0e8ccb5d80ca66
Author: Henry Gessau <email address hidden>
Date: Fri Mar 4 00:39:53 2016 -0500

    Fix branch order when upgrading to alembic milestone

    When using neutron-db-manage to upgrade to a milestone tag,
    the script was not ensuring that the expand branch was
    upgraded before the contract branch. This broke projects
    where contract migrations depend on expand migrations.

    Fixes-Bug: #1550434

    Change-Id: I0e6fc31dfa062c689936b2fe982147335ad9dce3
    (cherry picked from commit 1c67cda0f8ce5b6ff028d53cedbb792931fd96f6)

tags: added: in-stable-liberty
tags: removed: liberty-backport-potential
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.