RequestSpec records are never deleted when destroying an instance

Bug #1678056 reported by Sylvain Bauza
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Surya Seetharaman
Ocata
New
Undecided
Unassigned
Pike
Fix Committed
Medium
Matt Riedemann

Bug Description

When an instance is created, Nova adds a record in the API DB 'request_specs' table by providing the user request. That's used by the scheduler for knowing the boot request, also when the instance is moved afterwards.

That said, when destroying the instance, we don't delete the related RequestSpec record.
Of course, operators could run a script for deleting them by checking the instance UUIDs, but it would be better if when an instance is hard-deleted (ie. when operators don't use [DEFAULT]/reclaim_instance_interval for restoring deleted instances), we could then delete the RequestSpec too.

Tags: scheduler
Changed in nova:
status: Triaged → In Progress
Changed in nova:
assignee: Sylvain Bauza (sylvain-bauza) → Matt Riedemann (mriedem)
Revision history for this message
Sean Dague (sdague) wrote :

There are no currently open reviews on this bug, changing
the status back to the previous state and unassigning. If
there are active reviews related to this bug, please include
links in comments.

Changed in nova:
status: In Progress → Triaged
assignee: Matt Riedemann (mriedem) → nobody
Changed in nova:
assignee: nobody → Sylvain Bauza (sylvain-bauza)
status: Triaged → In Progress
Revision history for this message
Sylvain Bauza (sylvain-bauza) wrote :

Seems like the gerrit hook didn't work https://review.openstack.org/391060

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/484694

Changed in nova:
assignee: Sylvain Bauza (sylvain-bauza) → yuanyue (yyuanyuee)
tags: added: pike-rc-potential scheduler
Changed in nova:
assignee: yuanyue (yyuanyuee) → Sylvain Bauza (sylvain-bauza)
Revision history for this message
Sylvain Bauza (sylvain-bauza) wrote :
Revision history for this message
Matt Riedemann (mriedem) wrote :

This is not a pike-rc-potential bug in my opinion, it's a latent issue.

tags: removed: pike-rc-potential
Changed in nova:
assignee: Sylvain Bauza (sylvain-bauza) → Surya Seetharaman (tssurya)
Revision history for this message
Surya Seetharaman (tssurya) wrote :

Update : The latest revision of the fix for this is https://review.openstack.org/515034 (looks like gerrit hooking didn't work).

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

Reviewed: https://review.openstack.org/515034
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=32fd58813f8247641a6b574b5f01528b29d48b76
Submitter: Zuul
Branch: master

commit 32fd58813f8247641a6b574b5f01528b29d48b76
Author: Surya Seetharaman <email address hidden>
Date: Wed Oct 25 13:43:43 2017 +0200

    cleanup mapping/reqspec after archive instance

    This patch aims at deleting the records of the archived instances from
    the instance_mappings and request_specs tables in the API database
    immediately following their archival from instances to shadow_instances
    table. So upon running the 'nova-manage db archive_deleted_rows' command
    the records of the archived instances will be automatically removed from
    the instance_mappings and request_specs tables as well. A warning has
    also been added to fix the issue of 'nova-manage verify_instance'
    returning a valid instance mapping even after the instance is deleted.

    The patch also adds InstanceMappingList.destory_bulk() and
    RequestSpec.destroy_bulk() methods for ease of bulk deletion of records.

    Change-Id: I483701a55576c245d091ff086b32081b392f746e
    Closes-Bug: #1724621
    Closes-Bug: #1678056

Changed in nova:
status: In Progress → Fix Released
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.

Matt Riedemann (mriedem)
no longer affects: nova/newton
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/580775

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

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

commit 70de423255fd01822188bb9082a0c0cc1c8ec2d0
Author: Surya Seetharaman <email address hidden>
Date: Wed Oct 25 13:43:43 2017 +0200

    cleanup mapping/reqspec after archive instance

    This patch aims at deleting the records of the archived instances from
    the instance_mappings and request_specs tables in the API database
    immediately following their archival from instances to shadow_instances
    table. So upon running the 'nova-manage db archive_deleted_rows' command
    the records of the archived instances will be automatically removed from
    the instance_mappings and request_specs tables as well. A warning has
    also been added to fix the issue of 'nova-manage verify_instance'
    returning a valid instance mapping even after the instance is deleted.

    The patch also adds InstanceMappingList.destory_bulk() and
    RequestSpec.destroy_bulk() methods for ease of bulk deletion of records.

    Change-Id: I483701a55576c245d091ff086b32081b392f746e
    Closes-Bug: #1724621
    Closes-Bug: #1678056
    (cherry picked from commit 32fd58813f8247641a6b574b5f01528b29d48b76)

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

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

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.opendev.org/391060
Reason: We purge request specs when archiving deleted instances now so let's drop this.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by Stephen Finucane (<email address hidden>) on branch: master
Review: https://review.opendev.org/484694

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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