db: 'allocations' table migration and model have conflicting indexes

Bug #1563006 reported by Matt Riedemann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Invalid
Low
Matt Riedemann

Bug Description

The spec for the 'allocations' table in nova says there will be an index over the resource_provider_id, resource_class_id and used columns.

That's in the data model definition:

https://github.com/openstack/nova/blob/9bc935d7d059c5ad9ff563b373691c3134e8f3ac/nova/db/sqlalchemy/models.py#L1503-L1505

        Index('allocations_resource_provider_class_used_idx',
              'resource_provider_id', 'resource_class_id',
              'used'),

It's not, however, in the database migration that adds the table to the schema:

https://github.com/openstack/nova/blob/9bc935d7d059c5ad9ff563b373691c3134e8f3ac/nova/db/sqlalchemy/migrate_repo/versions/314_add_resource_provider_tables.py#L71-L73

    Index('allocations_resource_provider_class_id_idx',
          allocations.c.resource_provider_id,
          allocations.c.resource_class_id)

So we probably need a new migration to fix that index.

Matt Riedemann (mriedem)
Changed in nova:
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
Chris Dent (cdent) wrote :

It's in 318 from https://review.openstack.org/#/c/281837/ is it not?

Revision history for this message
Jay Pipes (jaypipes) wrote :

It is indeed. Matt, this was my fault. In the amended resource-providers spec:

https://review.openstack.org/#/c/283253/2/specs/mitaka/approved/resource-providers.rst

I changed the index. Chris subsequently corrected things in the patch referenced above.

-jay

Matt Riedemann (mriedem)
Changed in nova:
assignee: nobody → Matt Riedemann (mriedem)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

Changed in nova:
status: Confirmed → In Progress
Revision history for this message
Matt Riedemann (mriedem) wrote :

Damn, OK, I guess it is handled in https://review.openstack.org/#/c/281837/ .

Changed in nova:
status: In Progress → Invalid
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Matt Riedemann (<email address hidden>) on branch: master
Review: https://review.openstack.org/298423
Reason: This was already fixed in the 318 migration:

https://review.openstack.org/#/c/281837/

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.