← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1746373] Re: Placement APIs with missing conflict detection

 

Reviewed:  https://review.openstack.org/540919
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=f3b0cf39750f455f33d2e259690ce9050cd05236
Submitter: Zuul
Branch:    master

commit f3b0cf39750f455f33d2e259690ce9050cd05236
Author: Eric Fried <efried@xxxxxxxxxx>
Date:   Mon Feb 5 10:27:24 2018 -0600

    placement doc: Conflict caveat for DELETE APIs
    
    Since the DELETE /resource_providers/{u}/inventories and .../traits APIs
    don't have a way to accept generation, they're not "threadsafe" in the
    sense of multiple client threads managing traits/inventories for the
    same provider.  This change adds a note to the documentation for these
    APIs to this effect, suggesting the use of PUT with empty
    traits/inventories instead.
    
    Change-Id: Icfd79cc1f5a912131845a22b4fe900147b19f934
    Closes-Bug: #1746373


** Changed in: nova
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1746373

Title:
  Placement APIs with missing conflict detection

Status in OpenStack Compute (nova):
  Fix Released

Bug description:
  Placement has a few APIs which affect resource provider generation,
  but which do not accept the current resource provider generation and
  therefore cannot ensure consistency.  They are as follows:

  DELETE /resource_providers/{u}/inventories
  DELETE /resource_providers/{u}/traits

  POST /allocations

  PUT /allocations/{c}
  DELETE /allocations/{c}

  As an example of how this is broken:

  - X wants to remove all of provider {u}'s inventory in resource class VGPU.  He GETs inventory at generation 1, which happens to contain *only* VGPU.
  - Y wants to add some SRIOV_NET_VF inventory to {u}.  He GETs inventory at generation 1, adds the SRIOV_NET_VF inventory, and PUTs it back.  The server increments the generation to 2, and the provider now has both VGPU and SRIOV_NET_VF inventory.
  - X, thinking the provider only has VGPU resource, invokes DELETE /resource_providers/{u}/inventories, which succeeds, thereby blowing away the SRIOV_NET_VF inventory.

  Note that in the case of DELETE /resource_providers/{u}/inventories
  and .../traits, there is an alternative, PUT <empty>, which *does*
  accept the provider generation.

  For the allocations APIs, there is no alternative.  Though it could be
  argued that it should not be necessary to send generation with the
  allocations APIs.

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1746373/+subscriptions


References