postgresql downgrade fails in migration 018 and 002 due to foreign keys

Bug #1266595 reported by Jay Bryant
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Medium
Ivan Kolodyazhny

Bug Description

Similar to the problem reported in bug 1265944 for mysql, downgrades for postgresql also fail due to an attempt to drop tables that still have foreign keys defined.

The solution implemented for mysql does not work for postgresql. For postgresql we need to drop the table in question using the 'CASCADE' option.

Ivan Kolodyazhny (e0ne)
Changed in cinder:
status: New → Confirmed
Ivan Kolodyazhny (e0ne)
Changed in cinder:
assignee: nobody → Ivan Kolodyazhny (e0ne)
Revision history for this message
Jay Bryant (jsbryant) wrote :

Thanks for taking this Ivan. Had forgotten about it/not had time to look at it further.

Changed in cinder:
importance: Undecided → Medium
Ivan Kolodyazhny (e0ne)
Changed in cinder:
status: Confirmed → In Progress
Revision history for this message
Ivan Kolodyazhny (e0ne) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to cinder (master)

Reviewed: https://review.openstack.org/132201
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=9b94302d7b695dc25237a02e6c50ad1496b7c579
Submitter: Jenkins
Branch: master

commit 9b94302d7b695dc25237a02e6c50ad1496b7c579
Author: Ivan Kolodyazhny <email address hidden>
Date: Wed Oct 29 15:52:54 2014 +0200

    DB migration tests

    Refactored migration tests to use OpportunisticTestCase, removed
    unused code and ``test_migrations.conf`` file.

    The main feature of this approach is to create a new database with
    random name for each migration test. This will avoid migration tests of
    race conditions and reduce tests intersection. After this change, database
    ``openstack_citest`` will be used only for initial connection to the database.

    ``test_migrations.conf`` file not required anymore, because we create test
    database for migration test, so we no longer need to keep database credentials.

    Implements blueprint: db-migration-tests
    Related-bug: #1266595
    Change-Id: I4febd485ff53936b636947c86773a23724e24c65

Mike Perez (thingee)
Changed in cinder:
milestone: none → kilo-2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/141414
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=26b19e6353577b0dda52f921c3fe48bdb8e1a1c6
Submitter: Jenkins
Branch: master

commit 26b19e6353577b0dda52f921c3fe48bdb8e1a1c6
Author: Ivan Kolodyazhny <email address hidden>
Date: Fri Dec 12 18:11:58 2014 +0200

    Add migration tests for PostgreSQL

    Fix migrations for PostgresSQL:
    002_quota_class - PostgreSQL-specific reservations foreign key name
    004_volume_type_to_uuid - while downgraging volume_type_id from string to int
    PostgreSQL can't do it automatically

    Change-Id: I68b8608a85594501536835ddc9dc87bcd2dd80c4
    Closes-Bug: #1266595

Changed in cinder:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in cinder:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in cinder:
milestone: kilo-2 → 2015.1.0
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.