Placement: resource provider can't be deleted if there is trait associated with it

Bug #1727719 reported by Andrey Volkov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Takashi Natsume
Pike
Fix Committed
Medium
Takashi Natsume

Bug Description

nova: 6d61c61a32

To reproduce:
1. Create a new RP
2. Associate a trait with it.
3. Try to delete the RP.

Error:
Response:
{"computeFault": {"message": "The server has either erred or is incapable of performing the requested operation.", "code": 500}}

(Pdb) __exception__
(<class 'oslo_db.exception.DBReferenceError'>, DBReferenceError(u"(pymysql.err.IntegrityError) (1451, u'Cannot delete or update a parent row: a foreign key constraint fails (`nova_api`.`resource_provider_traits`, CONSTRAINT `resource_provider_traits_ibfk_1` FOREIGN KEY (`resource_provider_id`) REFERENCES `resource_providers` (`id`))') [SQL: u'DELETE FROM resource_providers WHERE resource_providers.id = %(id_1)s'] [parameters: {u'id_1': 17}]",))

Changed in nova:
assignee: nobody → Takashi NATSUME (natsume-takashi)
status: New → In Progress
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/516880

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

Reviewed: https://review.openstack.org/516880
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=5de3317d68df8fdc6fdaff62baa62822c669bb93
Submitter: Zuul
Branch: master

commit 5de3317d68df8fdc6fdaff62baa62822c669bb93
Author: Takashi NATSUME <email address hidden>
Date: Wed Nov 1 14:03:12 2017 +0900

    [placement] Fix foreign key constraint error

    When deleting a resource provider,
    if there are traits on the resource provider,
    a foreign key constraint error occurs.

    So add deleting trait associations for the resource provider
    (records in the 'resource_provider_traits' table)
    when deleting the resource provider.

    Change-Id: I6874567a14beb9b029765bf49067af6de17f2bd2
    Closes-Bug: #1727719

Changed in nova:
status: In Progress → Fix Released
Matt Riedemann (mriedem)
Changed in nova:
importance: Low → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/pike)

Fix proposed to branch: stable/pike
Review: https://review.openstack.org/525620

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 17.0.0.0b2

This issue was fixed in the openstack/nova 17.0.0.0b2 development milestone.

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

Reviewed: https://review.openstack.org/525620
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=fc225f16a12471bfde9d5d0d378e69fba201e58a
Submitter: Zuul
Branch: stable/pike

commit fc225f16a12471bfde9d5d0d378e69fba201e58a
Author: Takashi NATSUME <email address hidden>
Date: Wed Nov 1 14:03:12 2017 +0900

    [placement] Fix foreign key constraint error

    When deleting a resource provider,
    if there are traits on the resource provider,
    a foreign key constraint error occurs.

    So add deleting trait associations for the resource provider
    (records in the 'resource_provider_traits' table)
    when deleting the resource provider.

    Conflicts:
          nova/objects/resource_provider.py

    NOTE(mriedem): The conflict is due to changes introduced by
    b10f11d7e8e1afb7a12a470f92c42bf3c23eca95 in Queens which
    are not needed in Pike. The test also needed to change since
    1df5aad91017b4a7ef51fb6efac29e671f7cc7eb is not in Pike.

    Change-Id: I6874567a14beb9b029765bf49067af6de17f2bd2
    Closes-Bug: #1727719
    (cherry picked from commit 5de3317d68df8fdc6fdaff62baa62822c669bb93)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 16.0.4

This issue was fixed in the openstack/nova 16.0.4 release.

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.