Comment 32 for bug 1896463

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/train)

Reviewed: https://review.opendev.org/c/openstack/nova/+/841444
Committed: https://opendev.org/openstack/nova/commit/d5506014837097261231b205e9b3acbfa503b354
Submitter: "Zuul (22348)"
Branch: stable/train

commit d5506014837097261231b205e9b3acbfa503b354
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
    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)