Dependencies on conditionally disabled resources cause problems in legacy updates

Bug #1701677 reported by Zane Bitter
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
High
Zane Bitter

Bug Description

The fix for bug 1649900 allowed the user to define a resource that 'depends_on' a resource that is disabled at runtime using a conditon. This fix works well both when convergence is enabled and when creating a stack in the legacy path.

However, when doing a stack update in the legacy path, we copy resource definitions over one at a time as we create/update resources - but only resources that are enabled. So when we update a resource that 'depends_on' one that is conditionally disabled, the stored template will now contain a resource that 'depends_on' something that is not only not enabled, but not even defined in the template. Calculating the dependencies of this template will fail.

At the end of a successful update, the entire template is copied over verbatim, so there will be no long-term consequences. However, if the update fails then the existing template will be left in the inconsistent state (as will the template of the backup stack).

Possibly this is the cause of the problems reported in bug 1689553 and https://review.openstack.org/#/c/479016/ although it's not obvious that those cases involved resuming after a failed update. It's possible (although I can't immediately spot it) that something is recalculating the dependencies during the initial update itself and causing things to fail there. A stack trace would give us more information to go on.

Zane Bitter (zaneb)
Changed in heat:
importance: Undecided → High
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/479367

Changed in heat:
assignee: nobody → Zane Bitter (zaneb)
status: New → In Progress
Zane Bitter (zaneb)
Changed in heat:
milestone: none → pike-3
Rico Lin (rico-lin)
Changed in heat:
milestone: pike-3 → pike-rc1
Rabi Mishra (rabi)
Changed in heat:
milestone: pike-rc1 → pike-rc2
Rico Lin (rico-lin)
Changed in heat:
milestone: pike-rc2 → queens-1
Rico Lin (rico-lin)
Changed in heat:
milestone: queens-1 → pike-rc2
Rico Lin (rico-lin)
Changed in heat:
milestone: pike-rc2 → queens-1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/479367
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=c25034f5cd2e9182d9846cc39161cbf51deb664d
Submitter: Jenkins
Branch: master

commit c25034f5cd2e9182d9846cc39161cbf51deb664d
Author: Zane Bitter <email address hidden>
Date: Fri Jun 30 12:23:15 2017 -0400

    Strip disabled resources from depends_on in add_resource()

    When we add a resource to a template using add_resource(), strip any
    references to resources that are not present in the template from
    'depends_on'. This means that resources that are present and depended on
    but conditionally disabled in the source template will not be depended
    on in the destination template, where they're not present at all (and
    thus would cause errors when the template is used).

    Change-Id: I58a64cd523cc0d1da8cd39793f0c839189458d99
    Closes-Bug: #1701677
    Related-Bug: #1649900

Changed in heat:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (stable/pike)

Fix proposed to branch: stable/pike
Review: https://review.openstack.org/505668

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (stable/pike)

Reviewed: https://review.openstack.org/505668
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=670656703f5662da93bec3eb2584a64ee0418154
Submitter: Jenkins
Branch: stable/pike

commit 670656703f5662da93bec3eb2584a64ee0418154
Author: Zane Bitter <email address hidden>
Date: Fri Jun 30 12:23:15 2017 -0400

    Strip disabled resources from depends_on in add_resource()

    When we add a resource to a template using add_resource(), strip any
    references to resources that are not present in the template from
    'depends_on'. This means that resources that are present and depended on
    but conditionally disabled in the source template will not be depended
    on in the destination template, where they're not present at all (and
    thus would cause errors when the template is used).

    Change-Id: I58a64cd523cc0d1da8cd39793f0c839189458d99
    Closes-Bug: #1701677
    Related-Bug: #1649900
    (cherry picked from commit c25034f5cd2e9182d9846cc39161cbf51deb664d)

tags: added: in-stable-pike
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/heat 10.0.0.0b1

This issue was fixed in the openstack/heat 10.0.0.0b1 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/heat 9.0.1

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

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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