Reviewed: https://review.openstack.org/641137 Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=855b5546564f0ed96243623b67b1322e9b891c8b Submitter: Zuul Branch: master
commit 855b5546564f0ed96243623b67b1322e9b891c8b Author: Matt Riedemann <[email protected]> Date: Tue Mar 5 16:39:51 2019 -0500 Temporarily mutate migration object in finish_revert_resize As the comment in the code suggests, when calling migrate_instance_finish in finish_revert_resize we need to temporarily set the migration object dest_compute to the source_compute since we are moving port bindings from the dest back to the source. However, this is not really a temporary change to the object if something fails after this because the @errors_out_migration decorator will persist the change which could be confusing later if trying to debug this migration from the API and the dest_compute and source_compute have the same value. This fixes the issue by using the temporary_mutation utility. Also, the obj_to_primitive dance in here is removed since it is not necessary as migrate_instance_finish handles a Migration object. Change-Id: I312d61383345ea0ac1ab0c277b4c468e6aa94656 Closes-Bug: #1818730 ** Changed in: nova Status: In Progress => Fix Released -- 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/1818730 Title: Errors in finish_revert_resize can leave migration.dest_compute pointing at source_compute Status in OpenStack Compute (nova): Fix Released Bug description: Because of this code in finish_revert_resize: https://github.com/openstack/nova/blob/8cdb8cc7c56b574382b9a9fff662cc95e78136a2/nova/compute/manager.py#L4121 And the @errors_out_migration decorator on the method, if something fails after that line we will save the migration object changes which would leave the dest_compute pointing at the source_compute, which could be very confusing when trying to debug. The comment says the field is set temporarily but it's not really temporary if the migration changes are saved like in that decorator. To manage notifications about this bug go to: https://bugs.launchpad.net/nova/+bug/1818730/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : [email protected] Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp

