Downgrade V20 should delete tables in configuration

Bug #1361389 reported by Morgan Jones
This bug report is a duplicate of:  Bug #1347114: Migrate fails to downgrade database. Edit Remove
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack DBaaS (Trove)
In Progress
Low
Simon Chang

Bug Description

the v20 migration in trove/db/sqlalchemy/migrate_repo/versions/020_configurations.py does not delete the appropriate tables on downgrade, and instead adds an exception block to ignore exceptions that MAY be caused by "table already exists" type errors.

This has the following consequences:

- Exceptions in initially creating the tables/columns/etc will be ignored causing the upgrade migration to fail, yet the migration will continue with silent errors
- Exceptions in subsequent upgrades may fail for other errors that generate the same exceptions
- Errors caused by code in future versions that corrupt the data in the tables will not be cleared during the downgrade/upgrade process, effectively leaving the user in an unrecoverable state
- The configuration data left in the tables may have business relationships to data in other tables which are cleared during their downgrade, thus invalidating the retained data

For these reasons, the downgrade should drop the appropriate tables and the exception catching should be removed from the update method.

Simon Chang (changsimon)
Changed in trove:
assignee: nobody → Simon Chang (changsimon)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to trove (master)

Fix proposed to branch: master
Review: https://review.openstack.org/117048

Changed in trove:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on trove (master)

Change abandoned by Simon Chang (<email address hidden>) on branch: master
Review: https://review.openstack.org/117048

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to trove (master)

Fix proposed to branch: master
Review: https://review.openstack.org/117291

Revision history for this message
Simon Chang (changsimon) wrote :

cp16net, amcrn, vgnbkr and I discussed on the IRC and agreed that we won't drop the config tables on downgrade for v20. Code will be added in upgrade to detect table existence, create_table operation will be skipped and a warning will be logged if the tables already exist.

Changed in trove:
milestone: none → juno-rc1
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on trove (master)

Change abandoned by Simon Chang (<email address hidden>) on branch: master
Review: https://review.openstack.org/117291
Reason: Will be included in Change #113582.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.