commit 5566c3e6b194cbe682408ef9c88ad3b6a9755f7d Author: Andrew Beekhof Date: Wed Apr 9 12:07:46 2014 +1000 Fix: PE: Ensure unfencing occurs before fencing devices are (re-)probed (cherry picked from commit 6be22945726c204b9c73da843bb04981e46126be) Conflicts: pengine/test10/unfence-startup.summary diff --git a/lib/pengine/utils.c b/lib/pengine/utils.c index e84d341..9cb744a 100644 --- a/lib/pengine/utils.c +++ b/lib/pengine/utils.c @@ -1881,7 +1881,7 @@ trigger_unfencing( action_t *unfence = pe_fence_op(node, "on", FALSE, data_set); crm_notice("Unfencing %s: %s", node->details->uname, reason); - if(FALSE && dependancy) { + if(dependancy) { order_actions(unfence, dependancy, pe_order_optional); } diff --git a/pengine/native.c b/pengine/native.c index 3d75dc9..5c723c2 100644 --- a/pengine/native.c +++ b/pengine/native.c @@ -2518,8 +2518,21 @@ native_create_probe(resource_t * rsc, node_t * node, action_t * complete, } pe_rsc_debug(rsc, "Probing %s on %s (%s)", rsc->id, node->details->uname, role2text(rsc->role)); - order_actions(probe, complete, pe_order_implies_then); + if(is_set(rsc->flags, pe_rsc_fence_device) && is_set(data_set->flags, pe_flag_enable_unfencing)) { + /* Normally rsc.start depends on probe complete which depends + * on rsc.probe. But this can't be the case in this scenario as + * it would create graph loops. + * + * So instead we explicitly order 'rsc.probe then rsc.start' + */ + custom_action_order(rsc, NULL, probe, + rsc, generate_op_key(rsc->id, RSC_START, 0), NULL, + pe_order_optional, data_set); + + } else { + order_actions(probe, complete, pe_order_implies_then); + } return TRUE; } diff --git a/pengine/test10/unfence-definition.dot b/pengine/test10/unfence-definition.dot index e737687..6ab0e28 100644 --- a/pengine/test10/unfence-definition.dot +++ b/pengine/test10/unfence-definition.dot @@ -61,7 +61,7 @@ digraph "g" { "dlm_stop_0 virt-1" [ style=bold color="green" fontcolor="black"] "fencing_delete_0 virt-1" -> "fencing_start_0 virt-1" [ style = bold] "fencing_delete_0 virt-1" [ style=bold color="green" fontcolor="black"] -"fencing_monitor_0 virt-3" -> "probe_complete virt-3" [ style = bold] +"fencing_monitor_0 virt-3" -> "fencing_start_0 virt-1" [ style = bold] "fencing_monitor_0 virt-3" [ style=bold color="green" fontcolor="black"] "fencing_start_0 virt-1" [ style=bold color="green" fontcolor="black"] "fencing_stop_0 virt-1" -> "all_stopped" [ style = bold] @@ -89,6 +89,7 @@ digraph "g" { "stonith 'on' virt-1" [ style=bold color="green" fontcolor="black"] "stonith 'on' virt-3" -> "clvmd-clone_start_0" [ style = bold] "stonith 'on' virt-3" -> "dlm-clone_start_0" [ style = bold] +"stonith 'on' virt-3" -> "fencing_monitor_0 virt-3" [ style = bold] "stonith 'on' virt-3" [ style=bold color="green" fontcolor="black"] "stonith 'reboot' virt-4" -> "stonith_complete" [ style = bold] "stonith 'reboot' virt-4" [ style=bold color="green" fontcolor="black"] diff --git a/pengine/test10/unfence-definition.exp b/pengine/test10/unfence-definition.exp index 9075347..0f779da 100644 --- a/pengine/test10/unfence-definition.exp +++ b/pengine/test10/unfence-definition.exp @@ -19,6 +19,9 @@ + + + @@ -28,7 +31,11 @@ - + + + + + @@ -387,9 +394,6 @@ - - - diff --git a/pengine/test10/unfence-definition.summary b/pengine/test10/unfence-definition.summary index c954c4b..3e4b66b 100644 --- a/pengine/test10/unfence-definition.summary +++ b/pengine/test10/unfence-definition.summary @@ -20,7 +20,6 @@ Transition Summary: * Start clvmd:2 (virt-3) Executing cluster transition: - * Resource action: fencing monitor on virt-3 * Resource action: dlm monitor on virt-3 * Resource action: clvmd monitor on virt-2 * Resource action: clvmd monitor on virt-3 @@ -38,8 +37,9 @@ Executing cluster transition: * Fencing virt-3 (on) * Pseudo action: all_stopped * Fencing virt-1 (on) - * Resource action: fencing start on virt-1 + * Resource action: fencing monitor on virt-3 * Pseudo action: dlm-clone_start_0 + * Resource action: fencing start on virt-1 * Resource action: dlm start on virt-1 * Resource action: dlm start on virt-3 * Pseudo action: dlm-clone_running_0 diff --git a/pengine/test10/unfence-parameters.dot b/pengine/test10/unfence-parameters.dot index e67eb5a..082bbe1 100644 --- a/pengine/test10/unfence-parameters.dot +++ b/pengine/test10/unfence-parameters.dot @@ -78,7 +78,7 @@ digraph "g" { "dlm_stop_0 virt-2" -> "dlm_start_0 virt-2" [ style = bold] "dlm_stop_0 virt-2" -> "dlm_stop_0 virt-1" [ style = bold] "dlm_stop_0 virt-2" [ style=bold color="green" fontcolor="black"] -"fencing_monitor_0 virt-3" -> "probe_complete virt-3" [ style = bold] +"fencing_monitor_0 virt-3" -> "fencing_start_0 virt-1" [ style = bold] "fencing_monitor_0 virt-3" [ style=bold color="green" fontcolor="black"] "fencing_start_0 virt-1" [ style=bold color="green" fontcolor="black"] "fencing_stop_0 virt-1" -> "all_stopped" [ style = bold] @@ -111,6 +111,7 @@ digraph "g" { "stonith 'on' virt-2" [ style=bold color="green" fontcolor="black"] "stonith 'on' virt-3" -> "clvmd-clone_start_0" [ style = bold] "stonith 'on' virt-3" -> "dlm-clone_start_0" [ style = bold] +"stonith 'on' virt-3" -> "fencing_monitor_0 virt-3" [ style = bold] "stonith 'on' virt-3" [ style=bold color="green" fontcolor="black"] "stonith 'reboot' virt-4" -> "stonith_complete" [ style = bold] "stonith 'reboot' virt-4" [ style=bold color="green" fontcolor="black"] diff --git a/pengine/test10/unfence-parameters.exp b/pengine/test10/unfence-parameters.exp index 491d78e..d3480f3 100644 --- a/pengine/test10/unfence-parameters.exp +++ b/pengine/test10/unfence-parameters.exp @@ -19,7 +19,11 @@ - + + + + + @@ -36,6 +40,9 @@ + + + @@ -433,9 +440,6 @@ - - - diff --git a/pengine/test10/unfence-parameters.summary b/pengine/test10/unfence-parameters.summary index 17bbc62..5276cba 100644 --- a/pengine/test10/unfence-parameters.summary +++ b/pengine/test10/unfence-parameters.summary @@ -21,7 +21,6 @@ Transition Summary: * Start clvmd:2 (virt-3) Executing cluster transition: - * Resource action: fencing monitor on virt-3 * Resource action: dlm monitor on virt-3 * Resource action: clvmd monitor on virt-2 * Resource action: clvmd monitor on virt-3 @@ -40,6 +39,7 @@ Executing cluster transition: * Fencing virt-2 (on) * Pseudo action: all_stopped * Fencing virt-1 (on) + * Resource action: fencing monitor on virt-3 * Resource action: fencing start on virt-1 * Pseudo action: dlm-clone_start_0 * Resource action: dlm start on virt-1 diff --git a/pengine/test10/unfence-startup.dot b/pengine/test10/unfence-startup.dot index a5cc606..4dbd273 100644 --- a/pengine/test10/unfence-startup.dot +++ b/pengine/test10/unfence-startup.dot @@ -26,7 +26,6 @@ digraph "g" { "dlm:2_start_0 virt-3" -> "clvmd:2_start_0 virt-3" [ style = bold] "dlm:2_start_0 virt-3" -> "dlm-clone_running_0" [ style = bold] "dlm:2_start_0 virt-3" [ style=bold color="green" fontcolor="black"] -"fencing_monitor_0 virt-3" -> "probe_complete virt-3" [ style = bold] "fencing_monitor_0 virt-3" [ style=bold color="green" fontcolor="black"] "probe_complete virt-1" -> "probe_complete" [ style = bold] "probe_complete virt-1" [ style=bold color="green" fontcolor="black"] @@ -40,6 +39,7 @@ digraph "g" { "probe_complete" [ style=bold color="green" fontcolor="orange"] "stonith 'on' virt-3" -> "clvmd-clone_start_0" [ style = bold] "stonith 'on' virt-3" -> "dlm-clone_start_0" [ style = bold] +"stonith 'on' virt-3" -> "fencing_monitor_0 virt-3" [ style = bold] "stonith 'on' virt-3" [ style=bold color="green" fontcolor="black"] "stonith 'reboot' virt-4" -> "stonith_complete" [ style = bold] "stonith 'reboot' virt-4" [ style=bold color="green" fontcolor="black"] diff --git a/pengine/test10/unfence-startup.exp b/pengine/test10/unfence-startup.exp index 8a04d54..7c55d2c 100644 --- a/pengine/test10/unfence-startup.exp +++ b/pengine/test10/unfence-startup.exp @@ -6,7 +6,11 @@ - + + + + + @@ -186,9 +190,6 @@ - - - diff --git a/pengine/test10/unfence-startup.summary b/pengine/test10/unfence-startup.summary new file mode 100644 index 0000000..a03fa15 --- /dev/null +++ b/pengine/test10/unfence-startup.summary @@ -0,0 +1,48 @@ + +Current cluster status: +Node virt-4 (4): UNCLEAN (offline) +Online: [ virt-1 virt-2 virt-3 ] + + fencing (stonith:fence_scsi): Started virt-1 + Clone Set: dlm-clone [dlm] + Started: [ virt-1 virt-2 ] + Stopped: [ virt-3 virt-4 ] + Clone Set: clvmd-clone [clvmd] + Started: [ virt-1 ] + Stopped: [ virt-2 virt-3 virt-4 ] + +Transition Summary: + * Start dlm:2 (virt-3) + * Start clvmd:1 (virt-2) + * Start clvmd:2 (virt-3) + +Executing cluster transition: + * Resource action: dlm monitor on virt-3 + * Resource action: clvmd monitor on virt-2 + * Resource action: clvmd monitor on virt-3 + * Fencing virt-4 (reboot) + * Pseudo action: stonith_complete + * Pseudo action: probe_complete + * Fencing virt-3 (on) + * Pseudo action: all_stopped + * Resource action: fencing monitor on virt-3 + * Pseudo action: dlm-clone_start_0 + * Resource action: dlm start on virt-3 + * Pseudo action: dlm-clone_running_0 + * Pseudo action: clvmd-clone_start_0 + * Resource action: clvmd start on virt-2 + * Resource action: clvmd start on virt-3 + * Pseudo action: clvmd-clone_running_0 + +Revised cluster status: +Online: [ virt-1 virt-2 virt-3 ] +OFFLINE: [ virt-4 ] + + fencing (stonith:fence_scsi): Started virt-1 + Clone Set: dlm-clone [dlm] + Started: [ virt-1 virt-2 virt-3 ] + Stopped: [ virt-4 ] + Clone Set: clvmd-clone [clvmd] + Started: [ virt-1 virt-2 virt-3 ] + Stopped: [ virt-4 ] +