Activity log for bug #1745360

Date Who What changed Old value New value Message
2018-01-25 12:10:53 Shilpa Devharakar bug added bug
2018-01-29 06:13:42 Shilpa Devharakar 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
2018-01-29 09:02:17 Shilpa Devharakar summary DB Upgrade: Validation missing to check if E/M/C already executed DB Upgrade: Validation missing to check if E/M already executed
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.
2018-02-19 21:10:02 Brian Rosmaita glance: status New Triaged
2018-02-19 21:10:05 Brian Rosmaita glance: importance Undecided High
2018-02-19 21:10:29 Brian Rosmaita glance: assignee Shilpa Devharakar (shilpasd)
2018-02-19 21:10:37 Brian Rosmaita glance: milestone queens-rc3
2018-02-19 21:12:42 Brian Rosmaita glance: status Triaged In Progress
2018-02-20 01:51:29 OpenStack Infra glance: status In Progress Fix Released
2018-02-20 17:43:07 OpenStack Infra tags in-stable-queens