wrong migration version record in DB
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Shared File Systems Service (Manila) |
Fix Released
|
High
|
Valeriy Ponomaryov |
Bug Description
Alembic[?] writes wrong version of current migration that leads to errors with further actions with migrations. Because it tries to run migrations that already are applied.
Here is logs for clean installation:
$ manila-manage db sync
2015-07-10 18:56:09.519 DEBUG manila.utils [-] backend <module 'manila.
2015-07-10 18:56:09.535 DEBUG oslo_db.
2015-07-10 18:56:09.538 INFO alembic.migration [-] Context impl MySQLImpl.
2015-07-10 18:56:09.538 INFO alembic.migration [-] Will assume non-transactional DDL.
2015-07-10 18:56:09.585 INFO alembic.migration [-] Running upgrade -> 162a3e673105, manila_init
2015-07-10 18:56:10.270 DEBUG alembic.migration [-] new branch insert 162a3e673105 from (pid=19435) update_to_step /usr/local/
2015-07-10 18:56:10.274 INFO alembic.migration [-] Running upgrade 162a3e673105 -> 211836bf835c, add access level
2015-07-10 18:56:10.288 DEBUG alembic.migration [-] update 162a3e673105 to 211836bf835c from (pid=19435) update_to_step /usr/local/
2015-07-10 18:56:10.292 INFO alembic.migration [-] Running upgrade 211836bf835c -> 38e632621e5a, change volume_type to share_type
2015-07-10 18:56:10.292 INFO 38e632621e5a_
2015-07-10 18:56:10.307 INFO 38e632621e5a_
2015-07-10 18:56:10.349 INFO 38e632621e5a_
2015-07-10 18:56:10.410 INFO 38e632621e5a_
2015-07-10 18:56:10.413 INFO 38e632621e5a_
2015-07-10 18:56:10.446 DEBUG alembic.migration [-] update 211836bf835c to 38e632621e5a from (pid=19435) update_to_step /usr/local/
2015-07-10 18:56:10.454 INFO alembic.migration [-] Running upgrade 38e632621e5a -> 17115072e1c3, add_nova_
2015-07-10 18:56:10.610 DEBUG alembic.migration [-] update 38e632621e5a to 17115072e1c3 from (pid=19435) update_to_step /usr/local/
2015-07-10 18:56:10.733 INFO alembic.migration [-] Running upgrade 17115072e1c3 -> 4ee2cf4be19a, Remove share_snapshots
2015-07-10 18:56:11.436 DEBUG alembic.migration [-] update 17115072e1c3 to 4ee2cf4be19a from (pid=19435) update_to_step /usr/local/
2015-07-10 18:56:11.444 INFO alembic.migration [-] Running upgrade 4ee2cf4be19a -> 59eb64046740, Add required extra spec
/usr/local/
'strategies for improved performance.' % expr)
2015-07-10 18:56:11.450 DEBUG alembic.migration [-] update 4ee2cf4be19a to 59eb64046740 from (pid=19435) update_to_step /usr/local/
2015-07-10 18:56:11.523 INFO alembic.migration [-] Running upgrade 59eb64046740 -> ef0c02b4366, Add_share_
2015-07-10 18:56:11.991 DEBUG alembic.migration [-] update 59eb64046740 to ef0c02b4366 from (pid=19435) update_to_step /usr/local/
2015-07-10 18:56:11.992 INFO alembic.migration [-] Running upgrade ef0c02b4366 -> 30cb96d995fa, add public column for share
2015-07-10 18:56:12.14 DEBUG alembic.migration [-] update ef0c02b4366 to 30cb96d995fa from (pid=19435) update_to_step /usr/local/
2015-07-10 18:56:12.15 INFO alembic.migration [-] Running upgrade 30cb96d995fa -> 56cdbe267881, Add share_export_
2015-07-10 18:56:12.52 DEBUG alembic.migration [-] update 30cb96d995fa to 56cdbe267881 from (pid=19435) update_to_step /usr/local/
2015-07-10 18:56:12.53 INFO alembic.migration [-] Running upgrade 56cdbe267881 -> 3a482171410f, add_driver_
2015-07-10 18:56:12.63 DEBUG alembic.migration [-] update 56cdbe267881 to 3a482171410f from (pid=19435) update_to_step /usr/local/
2015-07-10 18:56:12.64 INFO alembic.migration [-] Running upgrade 3a482171410f -> 533646c7af38, Remove unused attr status
2015-07-10 18:56:12.103 DEBUG alembic.migration [-] update 3a482171410f to 533646c7af38 from (pid=19435) update_to_step /usr/local/
2015-07-10 18:56:12.104 INFO alembic.migration [-] Running upgrade 533646c7af38 -> 3db9992c30f3, Transform statuses to lowercase
2015-07-10 18:56:12.177 DEBUG alembic.migration [-] update 533646c7af38 to 3db9992c30f3 from (pid=19435) update_to_step /usr/local/
-------
mysql> select version_num from alembic_version;
+--------------+
| version_num |
+--------------+
| 3a482171410f |
+--------------+
1 row in set (0.01 sec)
-------
Alembic did not count last two versions '533646c7af38' and '3db9992c30f3'.
If we downgrade it to first, we will have DB record having value of second migration '211836bf835c' and not first '162a3e673105'.
==========
WORKAROUND
==========
Workaround is to change value of current version in DB:
DB 'manila'
table 'alembic_version'
set here version_num to required value:
UPDATE alembic_version SET version_num = 'fooversion';
tags: | added: alembic db migrations |
summary: |
- migrations are broken using alembic 0.7.6 + migrations are broken using alembic 0.7.4+ |
description: | updated |
description: | updated |
summary: |
- migrations are broken using alembic 0.7.4+ + wrong migration version record in DB |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
Changed in manila: | |
assignee: | nobody → Valeriy Ponomaryov (vponomaryov) |
milestone: | none → liberty-2 |
importance: | Undecided → High |
status: | New → In Progress |
Changed in manila: | |
status: | Fix Committed → Fix Released |
Changed in manila: | |
milestone: | liberty-2 → 1.0.0 |
Proof that CI has such problem: http:// logs.openstack. org/22/ 200622/ 3/check/ gate-manila- tempest- dsvm-neutron/ 1e4df60/ logs/devstacklo g.txt.gz# _2015-07- 11_15_14_ 19_686