[openstack-dev] [nova] [placement] placement api request analysis

Chris Dent cdent+os at anticdent.org
Mon Jan 30 13:29:29 UTC 2017


On Thu, 26 Jan 2017, Chris Dent wrote:
> On Wed, 25 Jan 2017, Chris Dent wrote:
>> #B3
>> The new GET to /placement/allocations is happening when the
>> resource tracker calls _update_usage_from_instance, which is always
>> being called becuause is_new_instance is always true in that method,
>> even when the instance is not "new". This is happening because the
>> tracked_instaces dict is _always_ getting cleared before
>> _update_usage_from_instance is being called. Which is weird because
>> it appears that it is that method's job to update tracked_instances.
>> If I remove the clear() the get on /placement/allocations goes away.
>> But I'm not sure what else this will break. The addition of that line
>> was a long time ago, in this change (I think):
>> https://review.openstack.org/#/c/13182/
>
> I made a bug about this:
>
>    https://bugs.launchpad.net/nova/+bug/1659647
>
> and have the gate looking at what breaks if the clear goes away:
>
>    https://review.openstack.org/#/c/425885/

Nothing broke, but discussion in IRC[1] suggests that the clearing
of tracked_instances is effectively a safety valve for those cases
where events which are supposed to change the state of an instance
somehow get lost or incorrect recorded. By flushing
tracked_instances are more complete accounting is performed.

This is something that ought to be fixed, but will require more
focused testing so presumably is a "later". We should figure it out,
though, because it is responsible for much of the traffic related to
checking allocations.

Meanwhile, the fix to comparing old and new compute node objects[2]
has merged. This removes 3 repeated (assuming no other changes) per
periodic job.

That means the current calculation for number of requests per
periodic job is:

   The requests done via _init_compute_node:
       GET aggregates to update local aggregates map        1
       GET inventories to compare with current inventory    1
   Calls from _update_usage_from_instances:
     remove_deleted_instances
       GET all the allocations for this resource provide    1
     _update_usage_from_instance
       GET allocations for consumer uuid                    1 per instance

3 + <number of instances>.

We can change this by:

* adding more smarts in _init_compute_node, but this impacts both
   our concept of "self-healing" inventory and the ability to
   dynamically manage aggregate associations

* adding more smarts with how tracked_instances is cleared or at
   least how the instances being tracked impacts when or how often a
   get allocations for consumer uuid is called

[1] Conversation between melwitt, cfriesen, superdan, me:
http://p.anticdent.org/3bbY

[2] https://review.openstack.org/#/c/424305/

-- 
Chris Dent                 ¯\_(ツ)_/¯           https://anticdent.org/
freenode: cdent                                         tw: @anticdent


More information about the OpenStack-dev mailing list