Migration testing with real data

Registered by Dan Smith on 2012-11-02

The summit session identified the need to do migration tests with more than an empty database to catch consistency issues. Migration tests should insert sample data into the database to make sure that data is not lost, corrupted, and that the migrations succeed.

Blueprint information

Status:
Complete
Approver:
Russell Bryant
Priority:
High
Drafter:
Sean Dague
Direction:
Approved
Assignee:
Kurt Taylor
Definition:
Approved
Series goal:
Accepted for grizzly
Implementation:
Implemented
Milestone target:
milestone icon 2013.1
Started by
Kurt Taylor on 2013-01-29
Completed by
Russell Bryant on 2013-03-05

Related branches

Sprints

Whiteboard

During the Folsom release cycle we found that many database migrations that had to manipulate data did so incorrectly. This would have caused substantial loss to a customer during their OpenStack upgrade. To prevent this we need an easy way to do data checks for key migrations, as well as populate some data in all the tables during the migration tests so that failures to convert can be caught in the CI system.

Gerrit topic: https://review.openstack.org/#q,topic:bp/migration-testing-with-data,n,z

Addressed by: https://review.openstack.org/20664
    refactored data upgrade tests in test_migrations

Gerrit topic: https://review.openstack.org/#q,topic:bug/1108448,n,z

Addressed by: https://review.openstack.org/21151
    Adds _prerun_134 function to populate 'bw_usage_cache' table

Gerrit topic: https://review.openstack.org/#q,topic:bug/1116236,n,z

Addressed by: https://review.openstack.org/21300
    Enhance IPAdresses migration tests and fix truncation issue

Etherpad work area for test coverage:
    https://etherpad.openstack.org/migration_with_data

Addressed by: https://review.openstack.org/21548
    Add and check data functions for test_migrations 141

Gerrit topic: https://review.openstack.org/#q,topic:21681,n,z

Addressed by: https://review.openstack.org/21681
    Canonizes IPv6 before insert it into the db

Addressed by: https://review.openstack.org/21804
    Add migration with data test for migration 151

Addressed by: https://review.openstack.org/22245

(?)

Work Items

Work items:
Refactor test_migrations to be able to run checks during walk_versions: DONE
Enable Posgresql in CI for unit tests so migrations are run on PG: DONE
Enhance IPAddress migration with max length IPv6 and IPv4 addresses: DONE
Enhance IPAddress migration with non-cannonical IPv6 strings (ensures pg conversion): DONE
Add _prerun_134 function to populate some data in all tables (ensure data is different in critical ways, AZ bug showed what can happen when that's not true): DONE
Add migration test for 141 instance uuid: DONE
Add migration test for 143 rename instance info cache: POSTPONED
Add migration test for 151 change task log: DONE

This blueprint contains Public information 
Everyone can see this information.