The _update_available_resources periodic makes resource allocation
adjustments while holding the COMPUTE_RESOURCE_SEMAPHORE based on the
list of instances assigned to this host of the resource tracker and
based on the migrations where the source or the target host is the host
of the resource tracker. So if the instance.host or the migration
context changes without holding the COMPUTE_RESOURCE_SEMAPHORE while
the _update_available_resources task is running there there will be data
inconsistency in the resource tracker.
This patch makes sure that during evacuation the instance.host and the
migration context is changed while holding the semaphore.
stable/train specific change: fair locking was introduced from ussuri
forward. See Ia5e521e0f0c7a78b5ace5de9f343e84d872553f9
So the train backport does not add fair=True to the synchronized
decorator of finish_evacuation as that would interfere with the other
functions taking the same lock without fair=True.
Change-Id: Ica180165184b319651d22fe77e076af036228860
Closes-Bug: #1896463
(cherry picked from commit 7675964af81472f3dd57db952d704539e61a3e6e)
(cherry picked from commit 3ecc098d28addd8f3e1da16b29940f4337209e62)
(cherry picked from commit 3b497ad7d41bc84ec50124c4d55f4138c4878751)
Reviewed: https:/ /review. opendev. org/c/openstack /nova/+ /841444 /opendev. org/openstack/ nova/commit/ d55060148370972 61231b205e9b3ac bfa503b354
Committed: https:/
Submitter: "Zuul (22348)"
Branch: stable/train
commit d55060148370972 61231b205e9b3ac bfa503b354
Author: Balazs Gibizer <email address hidden>
Date: Mon Sep 28 18:44:02 2020 +0200
Set instance host and drop migration under lock
The _update_ available_ resources periodic makes resource allocation RESOURCE_ SEMAPHORE based on the RESOURCE_ SEMAPHORE while available_ resources task is running there there will be data
adjustments while holding the COMPUTE_
list of instances assigned to this host of the resource tracker and
based on the migrations where the source or the target host is the host
of the resource tracker. So if the instance.host or the migration
context changes without holding the COMPUTE_
the _update_
inconsistency in the resource tracker.
This patch makes sure that during evacuation the instance.host and the
migration context is changed while holding the semaphore.
stable/train specific change: fair locking was introduced from ussuri 8b5ace5de9f343e 84d872553f9
forward. See Ia5e521e0f0c7a7
So the train backport does not add fair=True to the synchronized
decorator of finish_evacuation as that would interfere with the other
functions taking the same lock without fair=True.
Change-Id: Ica180165184b31 9651d22fe77e076 af036228860 3dd57db952d7045 39e61a3e6e) f3e1da16b29940f 4337209e62) ec50124c4d55f41 38c4878751)
Closes-Bug: #1896463
(cherry picked from commit 7675964af81472f
(cherry picked from commit 3ecc098d28addd8
(cherry picked from commit 3b497ad7d41bc84