neutron should automatically stamp the database version when it is deployed

Bug #1207402 reported by Jay Buffington
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
devstack
Fix Released
Undecided
Salvatore Orlando
neutron
Fix Released
High
Henry Gessau
Icehouse
New
Undecided
Unassigned

Bug Description

When neutron automatically deploys the database schema it does not "stamp" the version. According to neutron/db/migration/README this means that I have to stamp it to manually.

Neutron should automatically stamp the version to head when deploys the schema the first time. That way I don't have to determine what version I'm running so that I can do a schema migration.

Revision history for this message
Salvatore Orlando (salvatore-orlando) wrote :

Hi Jay,

We're already aware of this issue - and it is quite confusing for me too.
Actually, I am leaning towards ensuring Neutron behaves like any other Openstack service, relying solely on migrations for creating the database schema.

This would imply removing the code which auto-generates the schema, and adapting devstack to perform the migration.
Another issue with the current automatic schema generation is that it correctly adds new tables, but does not alter existing tables - so this why I am leaning for it to go.

However we need to see if that is something we can safely target for H-3.

I am assigning this bug to myself; before pushing a patch I will however consult with the community on the best approach to solve this problem.

Changed in neutron:
importance: Undecided → Medium
assignee: nobody → Salvatore Orlando (salvatore-orlando)
status: New → Triaged
importance: Medium → Undecided
Revision history for this message
Mark McClain (markmcclain) wrote :

+1 to doing this in H3. This will require a phased change to pass through the gate.

Changed in neutron:
importance: Undecided → High
tags: added: db neutron-core
Changed in neutron:
milestone: none → havana-3
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

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

Changed in devstack:
assignee: nobody → Salvatore Orlando (salvatore-orlando)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to devstack (master)

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

Changed in devstack:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

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

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

Reviewed: https://review.openstack.org/40243
Committed: http://github.com/openstack-dev/devstack/commit/dd64988ff4c0a174691cc7d45e3eaef8acdc4fc8
Submitter: Jenkins
Branch: master

commit dd64988ff4c0a174691cc7d45e3eaef8acdc4fc8
Author: Salvatore Orlando <email address hidden>
Date: Mon Aug 5 08:56:17 2013 -0700

    Run Neutron migrations after creating schema

    Partial-Bug 1207402

    This patch executes Neutron DB migrations (based on alembic)
    before starting the Neutron services, similar to what happens
    for most of other openstack projects managed by devstack.
    This will ensure devstack always creates correctly version-stamped
    Neutron databases.

    Change-Id: Ia941c426a1563bcc4cb5eae64ea30c0bf7677220

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

Reviewed: https://review.openstack.org/40241
Committed: http://github.com/openstack/neutron/commit/5d389270d92b7256642fa2c010d1a8f62bce85f2
Submitter: Jenkins
Branch: master

commit 5d389270d92b7256642fa2c010d1a8f62bce85f2
Author: Salvatore Orlando <email address hidden>
Date: Mon Aug 5 08:51:16 2013 -0700

    Remove global DB_ENGINE from Neutron

    Related-Bug 1207402

    This global is not used anymore as it's been replaced by a similar
    global variable in neutron/openstack/common/db/sqlalchemy/session.py

    Change-Id: Id4614069af490020d18f14011853787930076e0a

Changed in devstack:
status: In Progress → Fix Committed
Changed in neutron:
milestone: havana-3 → havana-rc1
Revision history for this message
Salvatore Orlando (salvatore-orlando) wrote :

The neutron patch for this is still under open discussion, and I therefore suggest untargeting.

the patch is likely to be abandoned - and no other patch should be pushed in lieu of it.

Changed in neutron:
milestone: havana-rc1 → none
tags: added: havana-rc-potential
Thierry Carrez (ttx)
tags: added: havana-backport-potential
removed: havana-rc-potential
Dean Troyer (dtroyer)
Changed in devstack:
status: Fix Committed → Fix Released
Revision history for this message
Salvatore Orlando (salvatore-orlando) wrote :

Just for info. What should we do on the neutron side?
Just set it invalid?

Henry Gessau (gessau)
Changed in neutron:
assignee: Salvatore Orlando (salvatore-orlando) → Henry Gessau (gessau)
Changed in neutron:
assignee: Henry Gessau (gessau) → Akihiro Motoki (amotoki)
Changed in neutron:
assignee: Akihiro Motoki (amotoki) → Henry Gessau (gessau)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to neutron (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/85568

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to neutron (master)

Reviewed: https://review.openstack.org/85568
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=acae91475775a8c85598b1bfdc4910e5fe81ced9
Submitter: Jenkins
Branch: master

commit acae91475775a8c85598b1bfdc4910e5fe81ced9
Author: Henry Gessau <email address hidden>
Date: Sat Apr 5 18:10:52 2014 -0400

    Add missing comma in nsx router mappings migration

    Change-Id: I85bcc9b7fe636f34dbdf6f8c3172352c8e586e2a
    Closes-bug: #1303179
    Related-bug: #1207402

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to neutron (milestone-proposed)

Related fix proposed to branch: milestone-proposed
Review: https://review.openstack.org/85629

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to neutron (milestone-proposed)

Reviewed: https://review.openstack.org/85629
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=ffe5cf1627b36fc32928d4cc50af1fb1336d0297
Submitter: Jenkins
Branch: milestone-proposed

commit ffe5cf1627b36fc32928d4cc50af1fb1336d0297
Author: Henry Gessau <email address hidden>
Date: Sat Apr 5 18:10:52 2014 -0400

    Add missing comma in nsx router mappings migration

    Change-Id: I85bcc9b7fe636f34dbdf6f8c3172352c8e586e2a
    Closes-bug: #1303179
    Related-bug: #1207402
    (cherry picked from commit acae91475775a8c85598b1bfdc4910e5fe81ced9)

Changed in neutron:
milestone: none → juno-1
Revision history for this message
Henry Gessau (gessau) wrote :

The following migration bugs were identified while working on this issue:

#1277379 folsom_initial db migration does not create quotas table
#1298456 db migration: quotas table is not created for NSX plugin
#1298461 embrane plugin lacks db migration
#1304741 folsom_initial migration has wrong type for brocadenetworks.id
#1300002 neutron-db-manage does not work properly when using Metaplugin

Fixes have been proposed for all of them, so now we are ready to merge this one?

Revision history for this message
Henry Gessau (gessau) wrote :

With the grenade job now voting, we also need https://review.openstack.org/85333 to merge.

Revision history for this message
Henry Gessau (gessau) wrote :

Wrong link in comment #15.

With the grenade job now voting, we also need https://review.openstack.org/85658 to merge.

Kyle Mestery (mestery)
Changed in neutron:
milestone: juno-1 → juno-2
Changed in neutron:
milestone: juno-2 → juno-3
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/40296
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=9bf0e6654480f98f2315a43687b267263a82a823
Submitter: Jenkins
Branch: master

commit 9bf0e6654480f98f2315a43687b267263a82a823
Author: Salvatore Orlando <email address hidden>
Date: Mon Aug 5 08:07:02 2013 -0700

    Remove auto-generation of db schema from models at startup

    This patch removes the Neutron capability of creating database tables
    from sqlalchemy models for all those model classes for which
    a table is not found in the database schema.
    Migrations should be the official and only solution for creating and
    managing the Neutron db schema.
    This patch also adapts unit tests in order to ensure test schemas
    are still correctly created.

    DocImpact
    Update deployment documentation accordingly.

    Closes-Bug: #1207402

    Change-Id: Ie4ee5507888ecad5f6dc32ce7a029c43014687a2
    Co-Authored-By: Henry Gessau <email address hidden>

Changed in neutron:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in neutron:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: juno-3 → 2014.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related blueprints

Remote bug watches

Bug watches keep track of this bug in other bug trackers.