Invalid test in cinder-api/extend_start.sh

Bug #1866827 reported by Gauvain Pocentek
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kolla
Fix Released
Medium
Gauvain Pocentek
Stein
Fix Released
Medium
Unassigned
Train
Fix Released
Medium
Radosław Piliszek
Ussuri
Fix Released
Medium
Gauvain Pocentek

Bug Description

The data migration script in cinder-api/extend_start.sh uses an incorrect test, leading to an invalid command being run. The current test is:

    if [[ -z ${MAX_NUMBER} ]]; then
        cinder-manage db online_data_migrations --max_count ${MAX_NUMBER}
    else
        cinder-manage db online_data_migrations
    fi

It should be something like:

    if [[ -n ${MAX_NUMBER} ]]; then
        cinder-manage db online_data_migrations --max_count ${MAX_NUMBER}
    else
        cinder-manage db online_data_migrations
    fi

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

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

Changed in kolla:
assignee: nobody → Gauvain Pocentek (gpocentek)
status: New → In Progress
Revision history for this message
Mark Goddard (mgoddard) wrote :

What command gets run? In what environment does this happen?

Revision history for this message
Gauvain Pocentek (gpocentek) wrote :

if MAX_NUMBER is not defined it will run "cinder-manage db online_data_migrations --max_count", which is invalid.

I'm using the containers without kolla-ansible, and I'm not setting the MAX_NUMBER variable. This happens on stein for centos-binary containers, but looking at the stable branches and master it is probably happening everywhere.

From what I've seen kolla-ansible always defines the MAX_NUMBER variable but I don't think it's actually used with that test.

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

Thanks for clarifying - makes sense.

Changed in kolla:
importance: Undecided → Medium
Revision history for this message
Dincer Celik (dincercelik) wrote :

@Mark,

I confirm we always run "cinder-manage db online_data_migrations" now although we set the MAX_NUMBER. This change fixes this to "cinder-manage db online_data_migrations --max_count 10".

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

Reviewed: https://review.opendev.org/712055
Committed: https://git.openstack.org/cgit/openstack/kolla/commit/?id=ff42ff20048ef3b7d2f8df04ada8ff4bf7b710e0
Submitter: Zuul
Branch: master

commit ff42ff20048ef3b7d2f8df04ada8ff4bf7b710e0
Author: Gauvain Pocentek <email address hidden>
Date: Tue Mar 10 12:46:17 2020 +0100

    Fix invalid test in cinder data migration script

    The extend_start.sh script for cinder-api uses an incorrect test to
    check if the MAX_NUMBER variable is set. This leads to a incorrect
    cinder-manage command being run if this variable is not set, making the
    database migration fail.

    This change fixes the test to properly use the MAX_NUMBER variable.

    Change-Id: Ie46da709db0de09a9cf641b3c154275282f213fc
    Closes-Bug: #1866827

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

Fix proposed to branch: stable/train
Review: https://review.opendev.org/715162

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

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

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

Reviewed: https://review.opendev.org/715163
Committed: https://git.openstack.org/cgit/openstack/kolla/commit/?id=4696fc0f322bdc4327b0ac4ec58f2ddc9d014ec1
Submitter: Zuul
Branch: stable/stein

commit 4696fc0f322bdc4327b0ac4ec58f2ddc9d014ec1
Author: Gauvain Pocentek <email address hidden>
Date: Tue Mar 10 12:46:17 2020 +0100

    Fix invalid test in cinder data migration script

    The extend_start.sh script for cinder-api uses an incorrect test to
    check if the MAX_NUMBER variable is set. This leads to a incorrect
    cinder-manage command being run if this variable is not set, making the
    database migration fail.

    This change fixes the test to properly use the MAX_NUMBER variable.

    Change-Id: Ie46da709db0de09a9cf641b3c154275282f213fc
    Closes-Bug: #1866827
    (cherry picked from commit ff42ff20048ef3b7d2f8df04ada8ff4bf7b710e0)

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

Reviewed: https://review.opendev.org/715162
Committed: https://git.openstack.org/cgit/openstack/kolla/commit/?id=60bbf85aa20cc38218123fb6fb7521268e3ac0f6
Submitter: Zuul
Branch: stable/train

commit 60bbf85aa20cc38218123fb6fb7521268e3ac0f6
Author: Gauvain Pocentek <email address hidden>
Date: Tue Mar 10 12:46:17 2020 +0100

    Fix invalid test in cinder data migration script

    The extend_start.sh script for cinder-api uses an incorrect test to
    check if the MAX_NUMBER variable is set. This leads to a incorrect
    cinder-manage command being run if this variable is not set, making the
    database migration fail.

    This change fixes the test to properly use the MAX_NUMBER variable.

    Change-Id: Ie46da709db0de09a9cf641b3c154275282f213fc
    Closes-Bug: #1866827
    (cherry picked from commit ff42ff20048ef3b7d2f8df04ada8ff4bf7b710e0)

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.