DB Upgrade: Validation missing to check if E/M already executed
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Glance |
Fix Released
|
High
|
Shilpa Devharakar |
Bug Description
Description
===========
There is no any validation present to check if Database is already expanded/migrated or contracted.
There has to be validation check so that system should not undergo in re-running expand/migrate or contract scripts if already executed.
Re-running same scripts causes Internal Errors so we should restrict reprocessing expand/migrate or contract scripts.
Steps to reproduce
==================
Let’s say if expand is run, and column is already altered, re-altering the same will throw Internal Error.
If you try to run 'glance-manage db_sync expand' command while upgrading from ocata to pike then it fails with below error:
INFO [alembic.
DBError: (pymysql.
Here ocata_expand01 is already processed, and system trying to re run the same and results into issue.
Expected result
===============
If expand/migrate is already executed, appropriate message should be delivered to operator.
Actual result
=============
On blank DB verified with queens empty scripts, below are the results:
EXPAND >> If we run glance-manage db expand, expand will execute with below message
Upgraded database to: queens_expand01, current revision(s): queens_expand01
If we again run glance-manage db expand, expand will again exeute with below message
Upgraded database to: queens_expand01, current revision(s): queens_expand01
MIGRATE >> Then we proceed with migrate, glance-manage db migrate, it will execute with below message
Migrated 0 rows ....Since no pending migrations.
If we again run glance-manage db migrate, migrate will again exeute with below message
Migrated 0 rows ....Since no pending migrations.
summary: |
- DB Upgrade: Validation missing to check if E/M/C already executed. + DB Upgrade: Validation missing to check if E/M/C already executed |
summary: |
- DB Upgrade: Validation missing to check if E/M/C already executed + DB Upgrade: Validation missing to check if E/M already executed |
description: | updated |
description: | updated |
Here's the patch: /review. openstack. org/#/c/ 540736/
https:/