Convergence: Re-trigger stack operation
Ensure stack operation is re-triggered when SynPointNotFound is encountered and stack is updated (have new traversal ID). Change-Id: Ia1b670aa5766c57dafdcc84d642c42007371a087
This commit is contained in:
parent
72f8bc4abc
commit
f1e1a73b83
|
@ -174,7 +174,7 @@ class WorkerService(service.Service):
|
||||||
def _retrigger_check_resource(self, cnxt, is_update, resource_id, stack):
|
def _retrigger_check_resource(self, cnxt, is_update, resource_id, stack):
|
||||||
current_traversal = stack.current_traversal
|
current_traversal = stack.current_traversal
|
||||||
graph = self._compute_dependencies(stack).graph()
|
graph = self._compute_dependencies(stack).graph()
|
||||||
key = sync_point.make_key(resource_id, current_traversal, is_update)
|
key = (resource_id, is_update)
|
||||||
predecessors = graph[key]
|
predecessors = graph[key]
|
||||||
|
|
||||||
def do_check(target_key, data):
|
def do_check(target_key, data):
|
||||||
|
@ -184,7 +184,7 @@ class WorkerService(service.Service):
|
||||||
try:
|
try:
|
||||||
sync_point.sync(cnxt, resource_id, current_traversal, is_update,
|
sync_point.sync(cnxt, resource_id, current_traversal, is_update,
|
||||||
do_check, predecessors, {key: None})
|
do_check, predecessors, {key: None})
|
||||||
except sync_point.sync_points.NotFound:
|
except sync_point.SyncPointNotFound:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def _initiate_propagate_resource(self, cnxt, resource_id,
|
def _initiate_propagate_resource(self, cnxt, resource_id,
|
||||||
|
|
|
@ -380,6 +380,26 @@ class CheckWorkflowUpdateTest(common.HeatTestCase):
|
||||||
mock_rcr.assert_called_once_with(self.ctx, self.is_update,
|
mock_rcr.assert_called_once_with(self.ctx, self.is_update,
|
||||||
self.resource.id, updated_stack)
|
self.resource.id, updated_stack)
|
||||||
|
|
||||||
|
@mock.patch.object(sync_point, 'sync')
|
||||||
|
def test_retrigger_check_resource(self, mock_sync, mock_cru, mock_crc,
|
||||||
|
mock_pcr, mock_csc, mock_cid):
|
||||||
|
self.is_update = True
|
||||||
|
resC = self.stack['C']
|
||||||
|
expected_graph_key = (resC.id, self.is_update)
|
||||||
|
# A, B are predecessors to C when is_update is True
|
||||||
|
expected_predecessors = {(self.stack['A'].id, True),
|
||||||
|
(self.stack['B'].id, True)}
|
||||||
|
self.worker._retrigger_check_resource(self.ctx, self.is_update,
|
||||||
|
resC.id, self.stack)
|
||||||
|
mock_sync.assert_called_once_with(self.ctx, resC.id,
|
||||||
|
self.stack.current_traversal,
|
||||||
|
self.is_update, mock.ANY,
|
||||||
|
mock.ANY,
|
||||||
|
{expected_graph_key: None})
|
||||||
|
call_args, call_kwargs = mock_sync.call_args
|
||||||
|
actual_predecessors = call_args[5]
|
||||||
|
self.assertItemsEqual(expected_predecessors, actual_predecessors)
|
||||||
|
|
||||||
|
|
||||||
@mock.patch.object(worker, 'construct_input_data')
|
@mock.patch.object(worker, 'construct_input_data')
|
||||||
@mock.patch.object(worker, 'check_stack_complete')
|
@mock.patch.object(worker, 'check_stack_complete')
|
||||||
|
|
Loading…
Reference in New Issue