RouterGateway and ExtraRoute do ReST calls to calculate dependencies

Bug #1626607 reported by Zane Bitter on 2016-09-22
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Rabi Mishra

Bug Description

RouterGateways depend on any RouterInterface attached to the same Router. Originally this was checked simply by looking up the `router_id` property of the RouterInterface and comparing it to the `router_id` property of the RouterGateway.

This changed in to do a lookup from the Neutron API of the RouterInterface's `router` property (which may be either a name or a UUID, but it returns a UUID). Doing API calls is very expensive and calculating dependencies is supposed to be something that is very cheap.

IMHO doing a lookup on the API is pointless anyway. The RouterGateway resource takes only a `router_id` (UUID), so the template author will either:

* Create the router in the template and use get_resource (in this case both the RouterGateway and the RouterInterface get passed a UUID for the router, so we can just directly compare them - but see below); OR
* Pass the router UUID in as a parameter and use get_param (in this case both the RouterGateway and the RouterInterface get passed a UUID for the router, so we can just directly compare them).

What they will approximately never do is pass in both the router UUID and router name as parameters and use the name for the `router` property in RouterInterface and the UUID for the `router_id` property in RouterGateway, so that we can't directly compare them without first resolving the name using the Neutron API.

IMHO unconditionally adding in an expensive API call to solve this total non-issue is crazy. The fix should be just to go back to essentially what we were doing before (except referencing `router` instead of `router_id`),

The same thing applies to OS::Neutron::ExtraRoute:

See further discussion in for context.

Zane Bitter (zaneb) on 2016-09-22
description: updated
Changed in heat:
assignee: nobody → Oleksii Chuprykov (ochuprykov)
Rabi Mishra (rabi) on 2016-11-16
Changed in heat:
milestone: ocata-1 → ocata-2
Rabi Mishra (rabi) on 2016-12-14
Changed in heat:
milestone: ocata-2 → ocata-3

Fix proposed to branch: master

Changed in heat:
assignee: Oleksii Chuprykov (ochuprykov) → Rabi Mishra (rabi)
status: Triaged → In Progress
Rabi Mishra (rabi) on 2017-01-25
Changed in heat:
milestone: ocata-3 → ocata-rc1

Submitter: Jenkins
Branch: master

commit b340c132a77b3ddf6f20d7a04191a7c7708386ba
Author: rabi <email address hidden>
Date: Mon Jan 23 10:39:55 2017 +0530

    Don't make client calls when adding dependencies

    There is no point making client calls when adding
    RouterInterface dependencies in the same stack for
    RouterGateway or ExtraRoute resources, as both of
    them have only router_id property. Therefore, if
    it's from parameter or get_resource it would always
    be the router_id.

    Change-Id: I575b714c9a3c7b9c95f7a8e59c915accbf7972f4
    Closes-Bug: #1626607

Changed in heat:
status: In Progress → Fix Released

This issue was fixed in the openstack/heat release candidate.

Zane Bitter (zaneb) wrote :

Bah, accidentally reset the milestone on the wrong bug. This was fixed in ocata-rc1.

Changed in heat:
milestone: ocata-rc1 → next
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers