Files
neutron-lib/neutron_lib/placement
Bence Romsics 755f6f462e Handle generation conflicts caused by concurrent updates
As discussed on the Nova-Neutron cross project session of the
Ussuri/Shanghai PTG [1]:

* Nova and Neutron will need to cooperate to identify the resource
  providers representing the same physical NICs.
* This will happen by Nova adding both RPs (created by Nova and
  Neutron respectively) representing the same physical NIC to one
  resource provider aggregate.
* Resource providers have a generation attribute to detect concurrent
  updates to the same RP (and its traits, inventories and aggregates).
* Therefore Neutron will start seeing update failures because of
  concurrent updates by Nova and retry its operation if it failed
  because of a concurrent (but otherwise irrelevant) update.

NOTE: The logic added to update inventory, inventories and traits
should be added to update resource provider too, but that API request
does not take a generation parameter today - which is likely a bug on
the placement side.

Generation conflicts are signalled not just by the 409 Conflict HTTP
response code but by the placement.concurrent_update error code inside
the HTTP JSON body. This is only available in Placement microversions
1.23+, therefore we bump the Placement microversion used in neutron-lib
to 1.23.

While implementing this change I noticed
that update_resource_provider_inventory and
update_resource_provider_inventories translated HTTP 409 Conflicts to
different neutron exception classes - which I deemed to be a bug in
placement client code and corrected it in this change too.

[1] https://etherpad.openstack.org/p/ptg-ussuri-xproj-nova-neutron

Change-Id: I2696c9e407cd5661a49d7d8c6b0232375682f827
2019-12-23 11:58:57 +01:00
..
2019-07-30 19:41:11 +02:00