Use of BIGINT for image size column causes sqlite problems
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Glance |
Fix Released
|
Medium
|
Eoghan Glynn |
Bug Description
To reproduce:
- using the diablo branch or packages
- configure to use sqlite
- ensure the database doesn't exist
- run glance-registry, observe the database is auto-created
- shut down glance-registry again
- version control the database (see bug #966242)
- switch to the essex branch or packages
- try to upgrade the database using 'glance-manage upgrade'
This is the error:
2012-03-27 14:19:07 13803 INFO [glance.
2012-03-27 14:19:07 13803 INFO [migrate.
2012-03-27 14:19:07 13803 INFO [migrate.
2012-03-27 14:19:07 13803 INFO [migrate.
/home/markmc/
...
File "/home/
images.
...
File "/home/
raise NotImplementedE
NotImplementedE
The problem stems from the fact that the auto-creation of the database with register_models() - as opposed to its creation using db_sync - creates a BIGINT column. When we try and upgrade, sqlalchemy doesn't recognize the type and sets it to NullType which the DDL compiler can't handle.
One solution would be to make sure the register_models() codepath doesn't create a BigInteger column with sqlite.
Another solution would be to just auto-create the DB using db_sync().
tags: | added: essex-rc-potential |
Changed in glance: | |
importance: | Undecided → Medium |
status: | New → Confirmed |
Changed in glance: | |
assignee: | nobody → Eoghan Glynn (eglynn) |
tags: | removed: essex-rc-potential |
Changed in glance: | |
milestone: | none → folsom-1 |
tags: | added: essex-rc-potential |
Changed in glance: | |
milestone: | folsom-1 → essex-rc3 |
tags: | removed: essex-rc-potential |
Changed in glance: | |
milestone: | essex-rc3 → 2012.1 |
OK, finally twigged that in order to reproduce this issue, the starting point version must be 9 as opposed to zero.
Whereas the instructions as stated will cause the version field in the migrate_version table to be set to zero, as the the following commit to allow a specific version be specified has not yet been applied to the stable diablo branch (and isn't directly applicable):
https:/ /github. com/openstack/ glance/ commit/ da66de06
Otherwise the Essex upgrade from version 0 fails with:
http:// paste.openstack .org/show/ 12345/
I've backported the "Allow specifying the current version in 'glance-manage version_control'" commit to diablo stable:
https:/ /review. openstack. org/6077
and with that patch in place, the bug is reproducible if the target version is explicitly set to 9:
sudo ./tools/ with_venv. sh bin/glance-manage version_control 9 --config-file ./etc/glance- registry. conf
before switching to the Essex branch.