db migration error with mariadb >= 10.2.8

Bug #1749184 reported by Stefan Nica
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Shared File Systems Service (Manila)
Fix Released
Critical
Stefan Nica

Bug Description

Starting with mariadb 10.2.8, a column cannot simply be dropped if it's part of a primary key (https://mariadb.com/kb/en/library/alter-table/#drop-column). Because of this, the manila db migration script that removes the 'host' column fails - in manila/db/migrations/alembic/versions/e8ea58723178_remove_host_from_driver_private_data.py:

def upgrade():
    try:
        op.drop_column(TABLE_NAME, COLUMN_HOST)
    except Exception:
        LOG.error("Column '%s' could not be dropped", COLUMN_HOST)
        raise

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

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

Changed in manila:
assignee: nobody → Stefan Nica (stefan.nica)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila (stable/pike)

Fix proposed to branch: stable/pike
Review: https://review.openstack.org/544040

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on manila (stable/pike)

Change abandoned by Stefan Nica (<email address hidden>) on branch: stable/pike
Review: https://review.openstack.org/544040
Reason: Not properly cherry-picked from master

tags: added: queens-rc2-potential
Changed in manila:
importance: Undecided → Critical
milestone: none → queens-rc2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (master)

Reviewed: https://review.openstack.org/543927
Committed: https://git.openstack.org/cgit/openstack/manila/commit/?id=2beb7ac13ab640c6178a711fc39c75bd71b2bc2c
Submitter: Zuul
Branch: master

commit 2beb7ac13ab640c6178a711fc39c75bd71b2bc2c
Author: Stefan Nica <email address hidden>
Date: Tue Feb 13 14:09:19 2018 +0100

    Fix db migration for mariadb >= 10.2.8

    Starting with mariadb 10.2.8, removing a column
    that is part of a primary key requires that the
    primary key constraint be dropped and recreated.

    Change-Id: I43e4dae325dd6561a9fe0fd4ce595cea4c2ef7a6
    Closes-Bug: #1749184

Changed in manila:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila (stable/queens)

Fix proposed to branch: stable/queens
Review: https://review.openstack.org/545981

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (stable/queens)

Reviewed: https://review.openstack.org/545981
Committed: https://git.openstack.org/cgit/openstack/manila/commit/?id=4a40da15fe0e9688c363371fd998ef7c3ba321ee
Submitter: Zuul
Branch: stable/queens

commit 4a40da15fe0e9688c363371fd998ef7c3ba321ee
Author: Stefan Nica <email address hidden>
Date: Tue Feb 13 14:09:19 2018 +0100

    Fix db migration for mariadb >= 10.2.8

    Starting with mariadb 10.2.8, removing a column
    that is part of a primary key requires that the
    primary key constraint be dropped and recreated.

    Change-Id: I43e4dae325dd6561a9fe0fd4ce595cea4c2ef7a6
    Closes-Bug: #1749184
    (cherry picked from commit 2beb7ac13ab640c6178a711fc39c75bd71b2bc2c)

tags: added: in-stable-queens
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/manila 6.0.0.0rc2

This issue was fixed in the openstack/manila 6.0.0.0rc2 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (stable/pike)

Reviewed: https://review.openstack.org/544040
Committed: https://git.openstack.org/cgit/openstack/manila/commit/?id=2bdd5e8063d6e18fa2d35f448d6159fa0180c11f
Submitter: Zuul
Branch: stable/pike

commit 2bdd5e8063d6e18fa2d35f448d6159fa0180c11f
Author: Stefan Nica <email address hidden>
Date: Tue Feb 13 14:09:19 2018 +0100

    Fix db migration for mariadb >= 10.2.8

    Starting with mariadb 10.2.8, removing a column
    that is part of a primary key requires that the
    primary key constraint be dropped and recreated.

    Change-Id: I43e4dae325dd6561a9fe0fd4ce595cea4c2ef7a6
    Closes-Bug: #1749184
    (cherry picked from commit 4a40da15fe0e9688c363371fd998ef7c3ba321ee)

tags: added: in-stable-pike
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/manila 7.0.0.0b1

This issue was fixed in the openstack/manila 7.0.0.0b1 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/manila 5.0.2

This issue was fixed in the openstack/manila 5.0.2 release.

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.