Unable to upgrade DB schema

Bug #1757076 reported by Masahito Muroi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Blazar
Fix Released
High
Masahito Muroi

Bug Description

The table schema difference between up-to-date OR mappers, defined in db/sqlalchemy/models.py, and real DB schema causes DB migration error when any schema change happens.

The upgrade script[1] sets lease status using db_api methods. The db_api methods try to query Blazar db with "up-to-date" OR mapper definitions. On the other hand, the real Blazar db doesn't have "up-to-data" because migration scripts which are applied after [1] is not executed yet. Because of the mismatching, db migration done by [1] will fail.

1. https://review.openstack.org/#/c/536649/

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

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

Changed in blazar:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to blazar (master)

Reviewed: https://review.openstack.org/559892
Committed: https://git.openstack.org/cgit/openstack/blazar/commit/?id=83860abbfe5d1c628a82b5fe1bb6b73498c4b5c2
Submitter: Zuul
Branch: master

commit 83860abbfe5d1c628a82b5fe1bb6b73498c4b5c2
Author: Masahito Muroi <email address hidden>
Date: Tue Apr 10 00:14:01 2018 +0900

    Replace db_api with sql query in migration script

    The db migration scripts are executed one by one. On the other
    hands, db_api always expects the up-to-date DB schema is defined
    in the Blazar DB. If db_api methods are executed in the middle
    of db migrations, the mis-match between the real schema and model
    definition causes migration error.

    This patch replaces db_api methods in migration scripts with
    sql queries. It prevents migration scrpits from the error.

    Change-Id: I0509b9c7dadd2df5e70360fe4673f8a71a4c5f3a
    Closes-Bug: #1757076

Changed in blazar:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/blazar 2.0.0.0b2

This issue was fixed in the openstack/blazar 2.0.0.0b2 development milestone.

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.