compute: Ensure pre-migrating instances are destroyed during init_host
Previously _destroy_evacuated_instances would not remove instances
associated with evacuation migration records in a pre-migrating state.
This could lead to a race between the original source host and the new
destination if the source returned early, calling init_instance during
the evacuation process.
This change now includes pre-migrating migration records when looking
for active evacuations. Additionally the dict of evacuating instances is
then returned to init_host and used to skip running init_instance
against such instances ensuring no race occurs between the two computes.
NOTE(lyarwood): Conflict due to edeeaf9102eccb78f1a2555c7e18c3d706f07639
not being present in stable/pike.
Reviewed: https:/ /review. openstack. org/621205 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=1abdb4ca224 36c5eabadeab46b 1237154c9cca92
Committed: https:/
Submitter: Zuul
Branch: stable/pike
commit 1abdb4ca22436c5 eabadeab46b1237 154c9cca92
Author: Lee Yarwood <email address hidden>
Date: Wed Apr 18 14:35:07 2018 +0100
compute: Ensure pre-migrating instances are destroyed during init_host
Previously _destroy_ evacuated_ instances would not remove instances
associated with evacuation migration records in a pre-migrating state.
This could lead to a race between the original source host and the new
destination if the source returned early, calling init_instance during
the evacuation process.
This change now includes pre-migrating migration records when looking
for active evacuations. Additionally the dict of evacuating instances is
then returned to init_host and used to skip running init_instance
against such instances ensuring no race occurs between the two computes.
NOTE(lyarwood): Conflict due to edeeaf9102eccb7 8f1a2555c7e18c3 d706f07639
not being present in stable/pike.
Conflicts:
nova/ tests/functiona l/regressions/ test_bug_ 1764883. py
Closes-bug: #1764883 f12a572d4f99c8e 9da4deab803 9cf64af73209106 8cfabeedaa) 248d246cb2ed196 068e20785c)
Change-Id: I379678dfdb2609
(cherry picked from commit c4988cdabf311d2
(cherry picked from commit 8bba879141d644b