Ensure upgrade step orchestration accross roles.
authorSofer Athlan-Guyot <sathlang@redhat.com>
Mon, 3 Apr 2017 16:28:21 +0000 (18:28 +0200)
committermarios <marios@redhat.com>
Tue, 4 Apr 2017 08:44:43 +0000 (11:44 +0300)
Currently we don't enforce step ordering across role, only within
role.  With custom role, we can reach a step5 on one role while the
cluster is still at step3, breaking the contract announced in the
README[1] where each step has a guarantied cluster state.

We have to remove the conditional here as well as jinja has no way to
access this information, but we need jinja to iterate over all enabled
role to create the orchestration.

This deals only with Upgrade tasks, there is another review to deal
with UpgradeBatch tasks.

[1] https://github.com/openstack/tripleo-heat-templates/blob/master/puppet/services/README.rst

Closes-Bug: #1679486

Change-Id: Ibc6b64424cde56419fe82f984d3cc3620f7eb028

puppet/major_upgrade_steps.j2.yaml

index 5aba90e..e4d1e2a 100644 (file)
@@ -40,11 +40,6 @@ conditions:
       equals:
         - {get_param: [role_data, {{role.name}}, upgrade_batch_tasks]}
         - []
-  {{role.name}}UpgradeConfigEnabled:
-    not:
-      equals:
-        - {get_param: [role_data, {{role.name}}, upgrade_tasks]}
-        - []
 {%- endfor %}
 
 resources:
@@ -188,7 +183,6 @@ resources:
   # do, and there should be minimal performance hit (creating the
   # config is cheap compared to the time to apply the deployment).
   {%- if step > 0 %}
-    condition: {{role.name}}UpgradeConfigEnabled
     {% if role.name in enabled_roles %}
     depends_on:
       - {{role.name}}Upgrade_Step{{step -1}}
@@ -204,9 +198,13 @@ resources:
   {{role.name}}Upgrade_Step{{step}}:
     type: OS::Heat::SoftwareDeploymentGroup
     {%- if step > 0 %}
-    condition: {{role.name}}UpgradeConfigEnabled
+    # Make sure we wait that all roles have finished their own
+    # previous step before going to the next, so we can guarantee
+    # state for each steps.
     depends_on:
-      - {{role.name}}Upgrade_Step{{step -1}}
+      {%- for role_inside in enabled_roles %}
+      - {{role_inside.name}}Upgrade_Step{{step -1}}
+      {%- endfor %}
     {%- endif %}
     properties:
       name: {{role.name}}Upgrade_Step{{step}}