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.
Reviewed: https:/ /review. opendev. org/754815 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=7675964af81 472f3dd57db952d 704539e61a3e6e
Committed: https:/
Submitter: Zuul
Branch: master
commit 7675964af81472f 3dd57db952d7045 39e61a3e6e
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.
Change-Id: Ica180165184b31 9651d22fe77e076 af036228860
Closes-Bug: #1896463