nova-manage db sync fails with MemoryError if large number passed as 'version'
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
sqlalchemy-migrate |
In Progress
|
Undecided
|
Dinesh Bhor |
Bug Description
nova-manage db sync fails with MemoryError if large number passed as 'version'
Command:
$ nova-manage db sync 2147483646
LOG:
2016-02-25 10:25:11.100 CRITICAL nova [-] MemoryError
2016-02-25 10:25:11.100 TRACE nova Traceback (most recent call last):
2016-02-25 10:25:11.100 TRACE nova File "/usr/local/
2016-02-25 10:25:11.100 TRACE nova sys.exit(main())
2016-02-25 10:25:11.100 TRACE nova File "/opt/stack/
2016-02-25 10:25:11.100 TRACE nova ret = fn(*fn_args, **fn_kwargs)
2016-02-25 10:25:11.100 TRACE nova File "/opt/stack/
2016-02-25 10:25:11.100 TRACE nova return migration.
2016-02-25 10:25:11.100 TRACE nova File "/opt/stack/
2016-02-25 10:25:11.100 TRACE nova return IMPL.db_
2016-02-25 10:25:11.100 TRACE nova File "/opt/stack/
2016-02-25 10:25:11.100 TRACE nova version)
2016-02-25 10:25:11.100 TRACE nova File "/usr/local/
2016-02-25 10:25:11.100 TRACE nova return _migrate(url, repository, version, upgrade=True, err=err, **opts)
2016-02-25 10:25:11.100 TRACE nova File "<decorator-
2016-02-25 10:25:11.100 TRACE nova File "/usr/local/
2016-02-25 10:25:11.100 TRACE nova return f(*a, **kw)
2016-02-25 10:25:11.100 TRACE nova File "/usr/local/
2016-02-25 10:25:11.100 TRACE nova changeset = schema.
2016-02-25 10:25:11.100 TRACE nova File "/usr/local/
2016-02-25 10:25:11.100 TRACE nova changeset = self.repository
2016-02-25 10:25:11.100 TRACE nova File "/usr/local/
2016-02-25 10:25:11.100 TRACE nova versions = range(int(start) + range_mod, int(end) + range_mod, step)
2016-02-25 10:25:11.100 TRACE nova MemoryError
2016-02-25 10:25:11.100 TRACE nova
This is because in changeset() method of /migrate/
used which generates a list of integers [2] all at once in memory causing MemoryError.
This issue is also there in cinder, glance and keystone as well.
[1] https:/
[2] https:/
Changed in sqlalchemy-migrate: | |
assignee: | nobody → Dinesh Bhor (dinesh-bhor) |
Fix proposed to branch: master /review. openstack. org/286389
Review: https:/