Alembic Version in DB is different compared to the value in migration.py

Asked by Rajiv Mucheli

Hi,

I am currently testing upgrade to Openstack Dalmatian release, in QA i see :

select * from alembic_version;
+-------------------+
| version_num |
+-------------------+
| 2024_1_contract01 |
+-------------------+

as per https://opendev.org/openstack/glance/src/branch/stable/2024.2/glance/db/sqlalchemy/alembic_migrations/versions the above is correct.

However as per : https://review.opendev.org/c/openstack/glance/+/916162, its incorrect right ? or only do SLURP releases get DB contract version update ?

Regards,
Rajiv

Question information

Language:
English Edit question
Status:
Answered
For:
Glance Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Abhishek Kekane (abhishek-kekane) said :
#1

Hi Rajiv,

There were no empty expand, migrate and contract scripts added in
damaltian, so it will show db sync version as 2024_1_contract01 only
because that script was added in caracal

Thanks & Best Regards,

Abhishek Kekane

On Thu, Nov 7, 2024 at 8:46 PM Rajiv Mucheli <
<email address hidden>> wrote:

> New question #819293 on Glance:
> https://answers.launchpad.net/glance/+question/819293
>
> Hi,
>
> I am currently testing upgrade to Openstack Dalmatian release, in QA i see
> :
>
> select * from alembic_version;
> +-------------------+
> | version_num |
> +-------------------+
> | 2024_1_contract01 |
> +-------------------+
>
> as per
> https://opendev.org/openstack/glance/src/branch/stable/2024.2/glance/db/sqlalchemy/alembic_migrations/versions
> the above is correct.
>
> However as per : https://review.opendev.org/c/openstack/glance/+/916162,
> its incorrect right ? or only do SLURP releases get DB contract version
> update ?
>
> Regards,
> Rajiv
>
> --
> You received this question notification because your team Glance Core
> security contacts is an answer contact for Glance.
>
>

Revision history for this message
Rajiv Mucheli (rajiv.mucheli) said :
#2

Hi Abhishek,

Thanks for the quick response.

To confirm, this is the expected version in DB for Dalmatian, correct ?

Regards,
Rajiv

Revision history for this message
Abhishek Kekane (abhishek-kekane) said :
#3

Yes, that is correct.
Thanks & Best Regards,

Abhishek Kekane

On Thu, Nov 7, 2024 at 9:00 PM Rajiv Mucheli <
<email address hidden>> wrote:

> Question #819293 on Glance changed:
> https://answers.launchpad.net/glance/+question/819293
>
> Rajiv Mucheli posted a new comment:
> Hi Abhishek,
>
> Thanks for the quick response.
>
> To confirm, this is the expected version in DB for Dalmatian, correct ?
>
> Regards,
> Rajiv
>
> --
> You received this question notification because you are subscribed to
> the question.
>
>

Revision history for this message
Lisa Medina (shouratied) said :
#4

If the versions do not match, you can manually stamp the database with the correct version using the Alembic command:

alembic stamp <revision_id>

Replace <revision_id> with the correct revision identifier from your migration script.
https://blockblast.org

Can you help with this problem?

Provide an answer of your own, or ask Rajiv Mucheli for more information if necessary.

To post a message you must log in.