Atomic ExtraRoute Resource

Start using Neutron's extraroute-atomic API to make
OS::Neutron::ExtraRoute free of lost updates because of
concurrency problems.

Related Neutron spec: https://review.opendev.org/655680

Change-Id: Ie9f6f47f17befd6a4e79e02e9f10b192927b6bd2
Story: #2005522
Task: #30641
This commit is contained in:
Bence Romsics 2019-04-26 14:28:40 +02:00 committed by Lajos Katona
parent 54015065d3
commit 629c250f61
1 changed files with 109 additions and 0 deletions

View File

@ -0,0 +1,109 @@
..
This work is licensed under a Creative Commons Attribution 3.0 Unported
License.
http://creativecommons.org/licenses/by/3.0/legalcode
==========================
Atomic ExtraRoute Resource
==========================
https://storyboard.openstack.org/#!/story/2005522
As we improve Neutron's extraroute API we could adapt Heat's
OS::Neutron::ExtraRoute resource to use the improved API and via that
turn the resource to a supported resource.
Problem description
===================
As discussed in an `openstack-discuss thread
<http://lists.openstack.org/pipermail/openstack-discuss/2019-April/005121.html>`_
we could improve the Neutron's extraroute API to better support Neutron
API clients, especially Heat.
The problem is that the current extraroute API does not allow atomic
additions/deletions of particular routing table entries. In the current
API the routes attribute of a router (containing all routing table
entries) must be updated at once. Therefore additions and deletions
must be performed on the client side. Therefore multiple clients race
to update the routes attribute and updates may get lost.
Proposed change
===============
Change OS::Neutron::ExtraRoute to use the new Neutron API (extension
extraroute-atomic) as it is specified in the `Atomic Extraroute API
Neutron RFE <https://bugs.launchpad.net/neutron/+bug/1826396>`_.
Keep the resource template format as it is today, that is:
::
extraroute0:
type: OS::Neutron::ExtraRoute
properties:
destination: 10.1.0.0/24
nexthop: 10.0.0.10
router_id: { get_resource: router0 }
Unit test and document the change.
Change the resource's support_status to SUPPORTED.
Alternatives
------------
We could introduce a OS::Neutron::ExtraRoutes resource (please note the
plural). Internally the the resource implementation would still use the
improved Neutron extraroute-atomic API. But the template syntax could allow
multiple routes in one resource;
::
extraroute1:
type: OS::Neutron::ExtraRoutes
properties:
router_id: { get_resource: router0 }
routes:
- destination: 10.1.0.0/24
nexthop: 10.0.0.10
This format could allow more efficient use of the Neutron API. But it would
be backwards incompatible with the previous unsupported
OS::Neutron::ExtraRoute resource.
Even if going with the proposed template syntax we may want to introduce a
new resource name to express the difference in behavior, for example:
OS::Neutron::AtomicExtraRoute.
Implementation
==============
Assignee(s)
-----------
Primary assignee: Bence Romsics <bence.romsics@ericsson.com>
Milestones
----------
Target Milestone for completion: Not known yet, please see Dependencies
(but I hope to complete the whole Neutron+Heat feature in the Train cycle,
so either milestone 2 or 3 for Heat).
Work Items
----------
* Change the resource implementation.
* Unit test the resource implementation.
* Document the change.
Dependencies
============
The completion of the Neutron API change is a pre-requisite to the proposed
Heat change. The proposed Neutron change is also under review at the time of
first publishing this spec. This spec may or may not need an update after the
Neutron spec is merged. All cross-project spec review is warmly welcome so
we can create a Neutron API that's easy to consume from Heat.