Monasca service upgrade lacks database migration

Bug #1832020 reported by Doug Szumski
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kolla-ansible
Fix Released
Medium
Mark Goddard
Rocky
Fix Committed
Medium
Doug Szumski
Stein
Fix Committed
Medium
Doug Szumski
Train
Fix Released
Medium
Mark Goddard

Bug Description

When running a Monasca service upgrade, no attempt is made to perform a database migration. This only occurs during a service deploy. The expected behaviour is that when I upgrade from Queens to Rocky, the DB migration should be invoked.

Seen on Rocky, upgrading from Queens.

Doug Szumski (dszumski)
Changed in kolla-ansible:
assignee: nobody → Doug Szumski (dszumski)
Revision history for this message
Mark Goddard (mgoddard) wrote :

Doug, I think we need to tackle this one at some point.

summary: - Monasca service upgrade
+ Monasca service upgrade lacks database migration
Revision history for this message
Doug Szumski (dszumski) wrote :

Agreed, will try and get something up soon.

Revision history for this message
Marcin Juszkiewicz (hrw) wrote :

Wasn't that handled with this commit?

commit ae8ce78e5517423a9a971472bec061079f1cabe7
Author: Doug Szumski <email address hidden>
Date: Wed Sep 19 16:34:04 2018 +0000

    Use alembic migrations to deploy Monasca DB

    Support has recently been added for managing the Monasca DB
    with alembic. This change takes advantage of that.

    Partially-Implements: blueprint monasca-containers
    Change-Id: I89084ac0076eff099e567b32de249df9f0115e82

diff --git docker/monasca/monasca-api/extend_start.sh docker/monasca/monasca-api/extend_start.sh
index 6152e416a..5ea66ca4c 100644
--- docker/monasca/monasca-api/extend_start.sh
+++ docker/monasca/monasca-api/extend_start.sh
@@ -5,15 +5,7 @@ SERVICE="monasca-api"
 # Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
 # of the KOLLA_BOOTSTRAP variable being set, including empty.
 if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
- # Set the database name in the monasca database schema
- sed "s/USE \`mon\`;/USE \`${MONASCA_DATABASE_NAME}\`;/g" \
- /monasca-api/devstack/files/schema/mon_mysql.sql > /tmp/mon_mysql.sql
- # Load the schema
- mysql --host=${MONASCA_DATABASE_ADDRESS} \
- --port=${MONASCA_DATABASE_PORT} \
- --user=${MONASCA_DATABASE_USER} \
- --password=${MONASCA_DATABASE_PASSWORD} \
- < /tmp/mon_mysql.sql
+ monasca_db upgrade
     exit 0
 fi

Revision history for this message
Mark Goddard (mgoddard) wrote :

We need to do this in upgrade.yml:

- include_tasks: bootstrap_service.yml

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

Fix proposed to branch: master
Review: https://review.opendev.org/689826

Changed in kolla-ansible:
assignee: Doug Szumski (dszumski) → Mark Goddard (mgoddard)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla-ansible (stable/stein)

Fix proposed to branch: stable/stein
Review: https://review.opendev.org/690529

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla-ansible (stable/rocky)

Fix proposed to branch: stable/rocky
Review: https://review.opendev.org/690530

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kolla-ansible (master)

Reviewed: https://review.opendev.org/689826
Committed: https://git.openstack.org/cgit/openstack/kolla-ansible/commit/?id=c6392ed1aad400c4333cd4e9537ef94eb6f0e97f
Submitter: Zuul
Branch: master

commit c6392ed1aad400c4333cd4e9537ef94eb6f0e97f
Author: Mark Goddard <email address hidden>
Date: Mon Oct 21 16:26:08 2019 +0100

    Perform database migration in monasca upgrade

    Currently the database is only synced during deployment. This change
    performs the sync during upgrade as well.

    Change-Id: Ia45fc733a1ab69de9d4762f5d9c8767041eeaed3
    Closes-Bug: #1832020

Changed in kolla-ansible:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kolla-ansible (stable/stein)

Reviewed: https://review.opendev.org/690529
Committed: https://git.openstack.org/cgit/openstack/kolla-ansible/commit/?id=17e9c399c5c23b4fdb7f18c6602ac04d48255815
Submitter: Zuul
Branch: stable/stein

commit 17e9c399c5c23b4fdb7f18c6602ac04d48255815
Author: Mark Goddard <email address hidden>
Date: Mon Oct 21 16:26:08 2019 +0100

    Perform database migration in monasca upgrade

    Currently the database is only synced during deployment. This change
    performs the sync during upgrade as well.

    Change-Id: Ia45fc733a1ab69de9d4762f5d9c8767041eeaed3
    Closes-Bug: #1832020

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kolla-ansible (stable/rocky)

Reviewed: https://review.opendev.org/690530
Committed: https://git.openstack.org/cgit/openstack/kolla-ansible/commit/?id=13d81a01a28ecf1e083a7882a98a9c8f09d2a99f
Submitter: Zuul
Branch: stable/rocky

commit 13d81a01a28ecf1e083a7882a98a9c8f09d2a99f
Author: Mark Goddard <email address hidden>
Date: Mon Oct 21 16:26:08 2019 +0100

    Perform database migration in monasca upgrade

    Currently the database is only synced during deployment. This change
    performs the sync during upgrade as well.

    Change-Id: Ia45fc733a1ab69de9d4762f5d9c8767041eeaed3
    Closes-Bug: #1832020

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/kolla-ansible 9.0.0.0rc1

This issue was fixed in the openstack/kolla-ansible 9.0.0.0rc1 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/kolla-ansible 7.2.0

This issue was fixed in the openstack/kolla-ansible 7.2.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/kolla-ansible 8.1.0

This issue was fixed in the openstack/kolla-ansible 8.1.0 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.