populate_queued_for_delete queries the cell database for instances even if there are no instance mappings to migrate in that cell

Bug #1817961 reported by Matt Riedemann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Matt Riedemann
Rocky
New
Undecided
Unassigned

Bug Description

If we get here:

https://github.com/openstack/nova/blob/eb93d0cffd11fcfca97b3d4679a0043142a5d998/nova/objects/instance_mapping.py#L169

And the results are empty we can move on to the next cell without querying the cell database since we have nothing to migrate.

Also, the joinedload on cell_mapping here:

https://github.com/openstack/nova/blob/eb93d0cffd11fcfca97b3d4679a0043142a5d998/nova/objects/instance_mapping.py#L164

Is not used so could also be removed.

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

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

Reviewed: https://review.openstack.org/639840
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=47061e699b9dbf6fdeea572a5abeaa72e499ec87
Submitter: Zuul
Branch: master

commit 47061e699b9dbf6fdeea572a5abeaa72e499ec87
Author: Matt Riedemann <email address hidden>
Date: Wed Feb 27 16:24:24 2019 -0500

    Optimize populate_queued_for_delete online data migration

    The data migration was needlessly querying the cell database
    for instances even if there were no instance mappings in that
    database that needed to be migrated. This simply continues to
    the next cell if the instance mappings in the current cell are
    migrated.

    While we're in here, the joinedload on 'cell_mapping' can be
    removed since it's not used.

    Closes-Bug: #1817961

    Change-Id: Idf35ed9d57945bc80fbd47393b7de076330160e6

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 19.0.0.0rc1

This issue was fixed in the openstack/nova 19.0.0.0rc1 release candidate.

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.