Comment 29 for bug 1821594

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

Reviewed: https://review.opendev.org/659338
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=dac3239e92fc1865cacc17bbfbd2316072a9d26e
Submitter: Zuul
Branch: stable/rocky

commit dac3239e92fc1865cacc17bbfbd2316072a9d26e
Author: Matt Riedemann <email address hidden>
Date: Wed May 15 12:27:17 2019 -0400

    [stable-only] Delete allocations even if _confirm_resize raises (part 2)

    The backport 37ac54a42ec91821d62864d63c486c002608491b to fix
    bug 1821594 did not account for how the _delete_allocation_after_move
    method before Stein is tightly coupled to the migration status
    being set to "confirmed" which is what the _confirm_resize method
    does after self.driver.confirm_migration returns.

    However, if self.driver.confirm_migration raises an exception
    we still want to cleanup the allocations held on the source node
    and for that we call _delete_allocation_after_move. But because
    of that tight coupling before Stein, we need to temporarily
    mutate the migration status to "confirmed" to get the cleanup
    method to do what we want.

    This isn't a problem starting in Stein because change
    I0851e2d54a1fdc82fe3291fb7e286e790f121e92 removed that
    tight coupling on the migration status, so this is a stable
    branch only change.

    Note that we don't call self.reportclient.delete_allocation_for_instance
    directly since before Stein we still need to account for a
    migration that does not move the source node allocations to the
    migration record, and that logic is in _delete_allocation_after_move.

    A simple unit test assertion is added here but the functional
    test added in change I9d6478f492351b58aa87b8f56e907ee633d6d1c6
    will assert the bug is fixed properly before Stein.

    Change-Id: I933687891abef4878de09481937d576ce5899511
    Closes-Bug: #1821594