2018-01-29 09:05:46 |
Shilpa Devharakar |
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 reproceesing expand/migrate or contract scripts.
Let’s say if expand is run, and column is already altered, re-altering the same will throw Internal Error. |
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 reproceesing expand/migrate or contract scripts.
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.runtime.migration] Running upgrade mitaka02 -> ocata_expand01, add visibility to images
DBError: (pymysql.err.InternalError) (1060, u"Duplicate column name 'visibility'") [SQL: u"ALTER TABLE images ADD COLUMN visibility ENUM('private','public','shared','community')"]
Here ocata_expand01 is already processed, and system trying to re run the same and results into issue.
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. |
|
2018-01-29 10:17:16 |
Shilpa Devharakar |
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 reproceesing expand/migrate or contract scripts.
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.runtime.migration] Running upgrade mitaka02 -> ocata_expand01, add visibility to images
DBError: (pymysql.err.InternalError) (1060, u"Duplicate column name 'visibility'") [SQL: u"ALTER TABLE images ADD COLUMN visibility ENUM('private','public','shared','community')"]
Here ocata_expand01 is already processed, and system trying to re run the same and results into issue.
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. |
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.runtime.migration] Running upgrade mitaka02 -> ocata_expand01, add visibility to images
DBError: (pymysql.err.InternalError) (1060, u"Duplicate column name 'visibility'") [SQL: u"ALTER TABLE images ADD COLUMN visibility ENUM('private','public','shared','community')"]
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. |
|