← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1563006] [NEW] db: 'allocations' table migration and model have conflicting indexes

 

Public bug reported:

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.

** Affects: nova
     Importance: Low
         Status: Confirmed


** Tags: allocations db scheduler

** Changed in: nova
       Status: New => Confirmed

** Changed in: nova
   Importance: Undecided => Low

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1563006

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

Status in OpenStack Compute (nova):
  Confirmed

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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1563006/+subscriptions


Follow ups