[placement] put allocations does not do a full overwrite of existing allocations

Bug #1707669 reported by Chris Dent
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Jay Pipes
Ocata
Fix Committed
Medium
Matt Riedemann

Bug Description

The presumption all along has been that when doing a PUT /allocations/{consumer_uuid} that the body of that request would fully replace any allocations associated with that consumer.

This has turned out not to be the case. The code [1] to clean up the current allocations was only deleting allocations where the consumer _and_ resource provider matched the incoming allocations. We want to wipe the slate.

Huge hat tip to gibi for doing the necessary digging to get this going.

[1] https://github.com/openstack/nova/blob/master/nova/objects/resource_provider.py#L1509-L1520

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/489273

Changed in nova:
assignee: nobody → Jay Pipes (jaypipes)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/489273
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=afab0ca0c8f4c68b8d6d8646f408e9522596870e
Submitter: Jenkins
Branch: master

commit afab0ca0c8f4c68b8d6d8646f408e9522596870e
Author: Jay Pipes <email address hidden>
Date: Mon Jul 31 12:28:38 2017 -0400

    placement: remove existing allocs when set allocs

    Bug #1707669 highlighted a situation that arose when attempting to
    remove part of an allocation for a source host during a resize
    operation where the exiting allocation was not being properly deleted.

    In this patch, we remove the part of the WHERE condition that limited
    deleted allocation records to only those referring to a particular
    resource provider. In doing so, we make the creation of an allocation
    for a consumer a proper overwrite operation.

    Change-Id: I0835e5b4f22277465012aab9a5bf474608cb533b
    Fixes-bug: #1707669

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/ocata)

Fix proposed to branch: stable/ocata
Review: https://review.openstack.org/490231

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

Reviewed: https://review.openstack.org/490231
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=9f4db205bbbb215e77741df22979a20d62d80ae8
Submitter: Jenkins
Branch: stable/ocata

commit 9f4db205bbbb215e77741df22979a20d62d80ae8
Author: Jay Pipes <email address hidden>
Date: Mon Jul 31 12:28:38 2017 -0400

    placement: remove existing allocs when set allocs

    Bug #1707669 highlighted a situation that arose when attempting to
    remove part of an allocation for a source host during a resize
    operation where the exiting allocation was not being properly deleted.

    In this patch, we remove the part of the WHERE condition that limited
    deleted allocation records to only those referring to a particular
    resource provider. In doing so, we make the creation of an allocation
    for a consumer a proper overwrite operation.

    Conflicts:
          nova/objects/resource_provider.py
          nova/tests/functional/db/test_resource_provider.py

    NOTE(mriedem): The conflicts are both due to changes in Pike that
    aren't needed here:

      a909673682cdd8f02ef0ae5e8c6f061640e320ff added user/project to allocations

      86fe9a70c24fce71bf85bfe39917073f833a0951 renamed context to ctx in tests

    Change-Id: I0835e5b4f22277465012aab9a5bf474608cb533b
    Fixes-bug: #1707669
    (cherry picked from commit afab0ca0c8f4c68b8d6d8646f408e9522596870e)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.