Set instance host and drop migration under lock
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. Change-Id: Ica180165184b319651d22fe77e076af036228860 Closes-Bug: #1896463
This commit is contained in:
@@ -219,13 +219,4 @@ class TestEvacuateResourceTrackerRace(
|
||||
server, {'OS-EXT-SRV-ATTR:host': 'host2', 'status': 'ACTIVE'})
|
||||
|
||||
self._assert_pci_device_allocated(server['id'], self.compute1_id)
|
||||
|
||||
# This is bug #1896463 as the PCI allocation was deleted by the racing
|
||||
# _update_available_resource periodic task.
|
||||
self._assert_pci_device_allocated(
|
||||
server['id'], self.compute2_id, num=0)
|
||||
|
||||
# FIXME(gibi): When this bug is fixed (or if you remove the sleeps
|
||||
# above to avoid the race condition) then we expect that the PCI
|
||||
# allocation exists on the destination host too.
|
||||
# self._assert_pci_device_allocated(server['id'], self.compute2_id)
|
||||
self._assert_pci_device_allocated(server['id'], self.compute2_id)
|
||||
|
||||
Reference in New Issue
Block a user