Can't rollback update with nested stack in progress

Bug #1446252 reported by Zane Bitter
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
High
Zane Bitter
Kilo
Won't Fix
High
Angus Salkeld

Bug Description

When an in-progress stack update fails (and rollback is enabled) or is cancelled, we attempt to roll back the stack to it's previous state. For nested stacks we do this by issuing a new update call with the previous template and parameters, without attempting to cancel a current update that may be in progress. As a result, if the nested stack is in progress at the time we are attempting to roll back the parent, the attempt to update the nested stack will fail and therefore the rollback will fail.

Zane Bitter (zaneb)
Changed in heat:
status: New → Triaged
importance: Undecided → High
Zane Bitter (zaneb)
tags: added: kilo-rc-potential
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/175606

Changed in heat:
assignee: nobody → Zane Bitter (zaneb)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

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

commit ad4c00e672fdd2c1c8461d7e4813dff4b093ae0f
Author: Zane Bitter <email address hidden>
Date: Mon Apr 20 19:12:07 2015 -0400

    Cancel nested stack updates when appropriate

    If a stack update is cancelled while the update of a nested stack is being
    processed, the nested stack update is no longer stopped since the
    implementation changed in Kilo to use the RPC API to control nested stacks.

    To alleviate this, use the RPC API to cancel the (nested) stack update when
    the resource update is cancelled. This results in a rollback of the nested
    stack, so if a subsequent attempt to roll back the ensted stack by doing a
    stack update fails due to the rollback already being in progress, just
    ignore the error and wait for the existing operation to complete.

    Change-Id: I3eacf216194517c995732a3f4de876551b70fe91
    Closes-Bug: #1446252

Changed in heat:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
tags: removed: kilo-rc-potential
Thierry Carrez (ttx)
Changed in heat:
milestone: none → liberty-1
status: Fix Committed → Fix Released
Zane Bitter (zaneb)
tags: added: kilo-backport-potential
Zane Bitter (zaneb)
tags: removed: kilo-backport-potential
Revision history for this message
Zane Bitter (zaneb) wrote :

I'm no longer sure this was the right fix. It kicks in not only when the stack is being rolled back, but on any sibling resource failure that causes the update to be cancelled (even if rollback is disabled). See bug 1475057 for details.

Revision history for this message
Angus Salkeld (asalkeld) wrote :

This is now needed purely as a code dependency for bug 1475057 to get merged.

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

Fix proposed to branch: stable/kilo
Review: https://review.openstack.org/225527

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on heat (stable/kilo)

Change abandoned by Angus Salkeld (<email address hidden>) on branch: stable/kilo
Review: https://review.openstack.org/225527

Thierry Carrez (ttx)
Changed in heat:
milestone: liberty-1 → 5.0.0
Revision history for this message
Zane Bitter (zaneb) wrote :

Note: this fix didn't work. See bug 1591337.

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/332967

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

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

commit 97a3670462d791587764b05c2e50a2bbd45521b0
Author: Zane Bitter <email address hidden>
Date: Fri Jul 22 11:14:54 2016 -0400

    Use handle_update_cancel() to cancel nested stack updates

    The code designed to deal with the case where an in-progress StackResource
    update is cancelled by stopping the update of the nested stack has never
    worked because it was erroneously trying to catch StopIteration exceptions
    instead of the actual exception raised when a generator is closed,
    GeneratorExit.

    This change moves the handling code to the new handle_update_cancel()
    mechanism instead. Using this mechanism also means that StackResources will
    be cancelled immediately, rather than waiting for up to error_wait_time
    before cancelling the nested stack update. The previous patch adds a grace
    period for IN_PROGRESS resources within the nested stack to complete, so we
    want to notify it straight away to begin that period (and to not start any
    new work).

    Since the grace period on the child stack means that the child is likely to
    still be IN_PROGRESS at the time we want to roll back, handle rollback by
    sending an update-cancel with rollback message to the child. Only if the
    child is no longer IN_PROGRESS will we start an update with the previous
    template. If it is still IN_PROGRESS then just wait for it to reach
    ROLLBACK_COMPLETE.

    Change-Id: Ide210f695446fe8de2057b3b74c276165a6f9f3f
    Closes-Bug: #1591337
    Closes-Bug: #1446252

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

This issue was fixed in the openstack/heat 7.0.0.0b3 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to heat (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/490810

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/490897

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to heat (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/490898

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on heat (master)

Change abandoned by Rico Lin (<email address hidden>) on branch: master
Review: https://review.openstack.org/490810
Reason: After discussion in previous PTG, we already provide other way to do this

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by Rico Lin (<email address hidden>) on branch: master
Review: https://review.openstack.org/490898
Reason: in prefer of https://review.openstack.org/#/q/status:open+project:openstack/heat+branch:master+topic:story/1669608

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by Rico Lin (<email address hidden>) on branch: master
Review: https://review.openstack.org/490897
Reason: in prefer of https://review.openstack.org/#/q/status:open+project:openstack/heat+branch:master+topic:story/1669608

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.