summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZane Bitter <zbitter@redhat.com>2018-09-05 19:25:52 -0400
committerZane Bitter <zbitter@redhat.com>2019-01-29 16:40:40 +1300
commite34da892901dbba709d3854f8979eee32594d916 (patch)
tree4afc9632476873330d8db2035da4dccee9916dcc
parent2c9f7781cc012d9e463b978fb81f0d0fbb45238d (diff)
downloadheat-e34da892901dbba709d3854f8979eee32594d916.tar.gz
Allow update of previously-replaced resources
The convergence prototype ignored checks of resources that had previously been replaced by another resource. However, it turns out that this was unnecessary in the final version of the prototype: https://github.com/zaneb/heat-convergence-prototype/commit/e9d2f833a53de1ab09e7d936a4826d36ed7bb68d Keeping this limitation prevents us from allowing users to roll back to a previously-existing resource if creating the replacement fails, other than by using the automated rollback mechanism (which is special-cased). Since the graph for the traversal is calculated at the start of the update, there's no need to limit which nodes are allowed to be checked. Only the selected resource will have an is_update=True node in the traversal graph. Removing this additional restriction allows us to improve the algorithm that chooses which resource to update. Since a new traversal ID is stored before we calculate the traversal graph, we can guarantee that no new resource checks will start (though some may still be happening) while the algorithm is choosing, so there's no danger of it picking a resource that later gets replaced. Since we're no longer treating automatic rollback as a special case, reset the replaced_by field whenever we update a previously-replaced resource. Change-Id: I04e7ad90944c2d03ce0e59ba16af9d60d6e01222 Story: #2003579 Task: 26197
-rw-r--r--heat/engine/check_resource.py8
-rw-r--r--heat/engine/resource.py2
2 files changed, 1 insertions, 9 deletions
diff --git a/heat/engine/check_resource.py b/heat/engine/check_resource.py
index 366567634..a2f6d842c 100644
--- a/heat/engine/check_resource.py
+++ b/heat/engine/check_resource.py
@@ -304,14 +304,6 @@ class CheckResource(object):
stack.adopt_stack_data = adopt_stack_data
stack.thread_group_mgr = self.thread_group_mgr
- if is_update:
- if (rsrc.replaced_by is not None and
- rsrc.current_template_id != tmpl.id):
- LOG.debug('Resource %s with id %s already replaced by %s; '
- 'not checking',
- rsrc.name, resource_id, rsrc.replaced_by)
- return
-
try:
check_resource_done = self._do_check_resource(cnxt,
current_traversal,
diff --git a/heat/engine/resource.py b/heat/engine/resource.py
index e4074fbe2..e35873ea5 100644
--- a/heat/engine/resource.py
+++ b/heat/engine/resource.py
@@ -1449,7 +1449,7 @@ class Resource(status.ResourceStatus):
self.state_set(self.UPDATE, self.FAILED,
six.text_type(failure))
raise failure
- self.replaced_by = None
+ self.replaced_by = None
runner = scheduler.TaskRunner(self.update, new_res_def,
new_template_id=template_id,