RouterGateway and ExtraRoute do ReST calls to calculate dependencies

Bug #1626607 reported by Zane Bitter
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Medium
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 https://review.openstack.org/#/c/235426/2/heat/engine/resources/openstack/neutron/router.py 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 https://review.openstack.org/#/c/235426/ (except referencing `router` instead of `router_id`),

The same thing applies to OS::Neutron::ExtraRoute: https://review.openstack.org/#/c/235426/2/heat/engine/resources/openstack/neutron/extraroute.py

See further discussion in https://review.openstack.org/#/c/289371/ for context.

Zane Bitter (zaneb)
description: updated
Changed in heat:
assignee: nobody → Oleksii Chuprykov (ochuprykov)
Rabi Mishra (rabi)
Changed in heat:
milestone: ocata-1 → ocata-2
Rabi Mishra (rabi)
Changed in heat:
milestone: ocata-2 → ocata-3
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

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

Changed in heat:
assignee: Oleksii Chuprykov (ochuprykov) → Rabi Mishra (rabi)
status: Triaged → In Progress
Rabi Mishra (rabi)
Changed in heat:
milestone: ocata-3 → ocata-rc1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/424032
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=b340c132a77b3ddf6f20d7a04191a7c7708386ba
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
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/heat 8.0.0.0rc1

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

Revision history for this message
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  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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