From f6ffb93edb68fc20d9fb6a1324bc724ecb131617 Mon Sep 17 00:00:00 2001 From: Ken Gaillot Date: Mon, 18 Jul 2016 14:55:12 -0500 Subject: [PATCH 1/4] Feature: libpengine: allow pe_order_same_node option for constraints With this option, a constraint between two actions applies only if they are scheduled on the same node. --- include/crm/pengine/status.h | 1 + pengine/graph.c | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/include/crm/pengine/status.h b/include/crm/pengine/status.h index d9f2ca5..94aa832 100644 --- a/include/crm/pengine/status.h +++ b/include/crm/pengine/status.h @@ -397,6 +397,7 @@ enum pe_ordering { pe_order_restart = 0x1000, /* 'then' is runnable if 'first' is optional or runnable */ pe_order_stonith_stop = 0x2000, /* only applies if the action is non-pseudo */ pe_order_serialize_only = 0x4000, /* serialize */ + pe_order_same_node = 0x8000, /* applies only if 'first' and 'then' are on same node */ pe_order_implies_first_printed = 0x10000, /* Like ..implies_first but only ensures 'first' is printed, not mandatory */ pe_order_implies_then_printed = 0x20000, /* Like ..implies_then but only ensures 'then' is printed, not mandatory */ diff --git a/pengine/graph.c b/pengine/graph.c index 0b7252d..9bc6731 100644 --- a/pengine/graph.c +++ b/pengine/graph.c @@ -509,6 +509,17 @@ update_action(action_t * then) } } + /* Disable constraint if it only applies when on same node, but isn't */ + if (is_set(other->type, pe_order_same_node) + && (first_node->details != then_node->details)) { + + crm_trace("Disabled constraint %s on %s -> %s on %s", + other->action->uuid, first_node->details->uname, + then->uuid, then_node->details->uname); + other->type = pe_order_none; + continue; + } + clear_bit(changed, pe_graph_updated_first); if (first->rsc != then->rsc -- 1.8.3.1 From 48622e7462f8a9bbb94d9cc925133f3afaa52629 Mon Sep 17 00:00:00 2001 From: Ken Gaillot Date: Mon, 18 Jul 2016 16:25:56 -0500 Subject: [PATCH 2/4] Fix: pengine: avoid transition loop for start-then-stop + unfencing Partial fix --- include/crm/pengine/status.h | 2 +- pengine/native.c | 37 ++++++++++++++++++++++++------------- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/include/crm/pengine/status.h b/include/crm/pengine/status.h index 94aa832..c376c73 100644 --- a/include/crm/pengine/status.h +++ b/include/crm/pengine/status.h @@ -206,7 +206,7 @@ struct node_s { # define pe_rsc_needs_quorum 0x10000000ULL # define pe_rsc_needs_fencing 0x20000000ULL # define pe_rsc_needs_unfencing 0x40000000ULL -# define pe_rsc_have_unfencing 0x80000000ULL +# define pe_rsc_have_unfencing 0x80000000ULL /* obsolete (not set or used by cluster) */ enum pe_graph_flags { pe_graph_none = 0x00000, diff --git a/pengine/native.c b/pengine/native.c index 9f659ef..9d9a2da 100644 --- a/pengine/native.c +++ b/pengine/native.c @@ -1342,30 +1342,41 @@ native_internal_constraints(resource_t * rsc, pe_working_set_t * data_set) if (is_stonith == FALSE && is_set(data_set->flags, pe_flag_enable_unfencing) - && is_set(rsc->flags, pe_rsc_needs_unfencing) - && is_not_set(rsc->flags, pe_rsc_have_unfencing)) { + && is_set(rsc->flags, pe_rsc_needs_unfencing)) { /* Check if the node needs to be unfenced first */ node_t *node = NULL; GHashTableIter iter; - if(rsc != top) { - /* Only create these constraints once, rsc is almost certainly cloned */ - set_bit_recursive(top, pe_rsc_have_unfencing); - } - g_hash_table_iter_init(&iter, rsc->allowed_nodes); while (g_hash_table_iter_next(&iter, NULL, (void **)&node)) { action_t *unfence = pe_fence_op(node, "on", TRUE, data_set); - custom_action_order(top, generate_op_key(top->id, top == rsc?RSC_STOP:RSC_STOPPED, 0), NULL, - NULL, strdup(unfence->uuid), unfence, - pe_order_optional, data_set); + crm_debug("Ordering any stops of %s before %s, and any starts after", + rsc->id, unfence->uuid); - crm_debug("Stopping %s prior to unfencing %s", top->id, unfence->uuid); + /* + * It would be more efficient to order clone resources once, + * rather than order each instance, but ordering the instance + * allows us to avoid unnecessary dependencies that might conflict + * with user constraints. + * + * @TODO: This constraint can still produce a transition loop if the + * resource has a stop scheduled on the node being unfenced, and + * there is a user ordering constraint to start some other resource + * (which will be ordered after the unfence) before stopping this + * resource. An example is "start some slow-starting cloned service + * before stopping an associated virtual IP that may be moving to + * it": + * stop this -> unfencing -> start that -> stop this + */ + custom_action_order(rsc, stop_key(rsc), NULL, + NULL, strdup(unfence->uuid), unfence, + pe_order_optional|pe_order_same_node, data_set); custom_action_order(NULL, strdup(unfence->uuid), unfence, - top, generate_op_key(top->id, RSC_START, 0), NULL, - pe_order_implies_then_on_node, data_set); + rsc, start_key(rsc), NULL, + pe_order_implies_then_on_node|pe_order_same_node, + data_set); } } -- 1.8.3.1 From 1122b1866f496124b346b75ff955be240553d28c Mon Sep 17 00:00:00 2001 From: Ken Gaillot Date: Tue, 19 Jul 2016 15:10:27 -0500 Subject: [PATCH 3/4] Test: pengine: update regression tests for new unfence ordering --- pengine/test10/unfence-definition.dot | 14 ++++----- pengine/test10/unfence-definition.exp | 34 +++++++++------------ pengine/test10/unfence-definition.summary | 12 ++++---- pengine/test10/unfence-parameters.dot | 21 ++++++------- pengine/test10/unfence-parameters.exp | 51 +++++++++++++------------------ pengine/test10/unfence-parameters.summary | 14 ++++----- pengine/test10/unfence-startup.dot | 4 +-- pengine/test10/unfence-startup.exp | 12 ++++---- pengine/test10/unfence-startup.summary | 2 +- 9 files changed, 72 insertions(+), 92 deletions(-) diff --git a/pengine/test10/unfence-definition.dot b/pengine/test10/unfence-definition.dot index 1ae2367..a9e7e6b 100644 --- a/pengine/test10/unfence-definition.dot +++ b/pengine/test10/unfence-definition.dot @@ -12,8 +12,6 @@ digraph "g" { "clvmd-clone_stop_0" [ style=bold color="green" fontcolor="orange"] "clvmd-clone_stopped_0" -> "clvmd-clone_start_0" [ style = bold] "clvmd-clone_stopped_0" -> "dlm-clone_stop_0" [ style = bold] -"clvmd-clone_stopped_0" -> "stonith 'on' virt-1" [ style = bold] -"clvmd-clone_stopped_0" -> "stonith 'on' virt-3" [ style = bold] "clvmd-clone_stopped_0" [ style=bold color="green" fontcolor="orange"] "clvmd:1_monitor_0 virt-2" -> "clvmd-clone_start_0" [ style = bold] "clvmd:1_monitor_0 virt-2" [ style=bold color="green" fontcolor="black"] @@ -32,6 +30,7 @@ digraph "g" { "clvmd_stop_0 virt-1" -> "clvmd-clone_stopped_0" [ style = bold] "clvmd_stop_0 virt-1" -> "clvmd_start_0 virt-1" [ style = bold] "clvmd_stop_0 virt-1" -> "dlm_stop_0 virt-1" [ style = bold] +"clvmd_stop_0 virt-1" -> "stonith 'on' virt-1" [ style = bold] "clvmd_stop_0 virt-1" [ style=bold color="green" fontcolor="black"] "dlm-clone_running_0" -> "clvmd-clone_start_0" [ style = bold] "dlm-clone_running_0" [ style=bold color="green" fontcolor="orange"] @@ -43,8 +42,6 @@ digraph "g" { "dlm-clone_stop_0" -> "dlm_stop_0 virt-1" [ style = bold] "dlm-clone_stop_0" [ style=bold color="green" fontcolor="orange"] "dlm-clone_stopped_0" -> "dlm-clone_start_0" [ style = bold] -"dlm-clone_stopped_0" -> "stonith 'on' virt-1" [ style = bold] -"dlm-clone_stopped_0" -> "stonith 'on' virt-3" [ style = bold] "dlm-clone_stopped_0" [ style=bold color="green" fontcolor="orange"] "dlm:2_monitor_0 virt-3" -> "dlm-clone_start_0" [ style = bold] "dlm:2_monitor_0 virt-3" -> "stonith 'on' virt-3" [ style = bold] @@ -58,6 +55,7 @@ digraph "g" { "dlm_stop_0 virt-1" -> "all_stopped" [ style = bold] "dlm_stop_0 virt-1" -> "dlm-clone_stopped_0" [ style = bold] "dlm_stop_0 virt-1" -> "dlm_start_0 virt-1" [ style = bold] +"dlm_stop_0 virt-1" -> "stonith 'on' virt-1" [ style = bold] "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"] @@ -69,11 +67,11 @@ digraph "g" { "fencing_stop_0 virt-1" -> "fencing_delete_0 virt-1" [ style = bold] "fencing_stop_0 virt-1" -> "fencing_start_0 virt-1" [ style = bold] "fencing_stop_0 virt-1" [ style=bold color="green" fontcolor="black"] -"stonith 'on' virt-1" -> "clvmd-clone_start_0" [ style = bold] -"stonith 'on' virt-1" -> "dlm-clone_start_0" [ style = bold] +"stonith 'on' virt-1" -> "clvmd_start_0 virt-1" [ style = bold] +"stonith 'on' virt-1" -> "dlm_start_0 virt-1" [ style = bold] "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" -> "clvmd:2_start_0 virt-3" [ style = bold] +"stonith 'on' virt-3" -> "dlm:2_start_0 virt-3" [ 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] diff --git a/pengine/test10/unfence-definition.exp b/pengine/test10/unfence-definition.exp index 9d23a2a..64b9735 100644 --- a/pengine/test10/unfence-definition.exp +++ b/pengine/test10/unfence-definition.exp @@ -69,6 +69,9 @@ + + + @@ -104,6 +107,9 @@ + + + @@ -173,12 +179,6 @@ - - - - - - @@ -195,6 +195,9 @@ + + + @@ -258,6 +261,9 @@ + + + @@ -332,12 +338,6 @@ - - - - - - @@ -387,12 +387,6 @@ - - - - - - @@ -403,10 +397,10 @@ - + - + diff --git a/pengine/test10/unfence-definition.summary b/pengine/test10/unfence-definition.summary index a317807..05f8003 100644 --- a/pengine/test10/unfence-definition.summary +++ b/pengine/test10/unfence-definition.summary @@ -26,23 +26,23 @@ Executing cluster transition: * Pseudo action: clvmd-clone_stop_0 * Fencing virt-4 (reboot) * Pseudo action: stonith_complete + * Fencing virt-3 (on) + * Resource action: fencing monitor on virt-3 + * Resource action: fencing stop on virt-1 * Resource action: clvmd stop on virt-1 * Pseudo action: clvmd-clone_stopped_0 + * Resource action: fencing delete on virt-1 * Pseudo action: dlm-clone_stop_0 * Resource action: dlm stop on virt-1 * Pseudo action: dlm-clone_stopped_0 - * Fencing virt-3 (on) - * Fencing virt-1 (on) - * Resource action: fencing monitor on virt-3 - * Resource action: fencing stop on virt-1 * Pseudo action: dlm-clone_start_0 + * Fencing virt-1 (on) * Pseudo action: all_stopped - * Resource action: fencing delete on virt-1 + * 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 * Pseudo action: clvmd-clone_start_0 - * Resource action: fencing start on virt-1 * Resource action: clvmd start on virt-1 * Resource action: clvmd start on virt-2 * Resource action: clvmd start on virt-3 diff --git a/pengine/test10/unfence-parameters.dot b/pengine/test10/unfence-parameters.dot index 6b23965..c96d314 100644 --- a/pengine/test10/unfence-parameters.dot +++ b/pengine/test10/unfence-parameters.dot @@ -12,9 +12,6 @@ digraph "g" { "clvmd-clone_stop_0" [ style=bold color="green" fontcolor="orange"] "clvmd-clone_stopped_0" -> "clvmd-clone_start_0" [ style = bold] "clvmd-clone_stopped_0" -> "dlm-clone_stop_0" [ style = bold] -"clvmd-clone_stopped_0" -> "stonith 'on' virt-1" [ style = bold] -"clvmd-clone_stopped_0" -> "stonith 'on' virt-2" [ style = bold] -"clvmd-clone_stopped_0" -> "stonith 'on' virt-3" [ style = bold] "clvmd-clone_stopped_0" [ style=bold color="green" fontcolor="orange"] "clvmd:1_monitor_0 virt-2" -> "clvmd-clone_start_0" [ style = bold] "clvmd:1_monitor_0 virt-2" -> "stonith 'on' virt-2" [ style = bold] @@ -37,6 +34,7 @@ digraph "g" { "clvmd_stop_0 virt-1" -> "clvmd-clone_stopped_0" [ style = bold] "clvmd_stop_0 virt-1" -> "clvmd_start_0 virt-1" [ style = bold] "clvmd_stop_0 virt-1" -> "dlm_stop_0 virt-1" [ style = bold] +"clvmd_stop_0 virt-1" -> "stonith 'on' virt-1" [ style = bold] "clvmd_stop_0 virt-1" [ style=bold color="green" fontcolor="black"] "dlm-clone_running_0" -> "clvmd-clone_start_0" [ style = bold] "dlm-clone_running_0" [ style=bold color="green" fontcolor="orange"] @@ -50,9 +48,6 @@ digraph "g" { "dlm-clone_stop_0" -> "dlm_stop_0 virt-2" [ style = bold] "dlm-clone_stop_0" [ style=bold color="green" fontcolor="orange"] "dlm-clone_stopped_0" -> "dlm-clone_start_0" [ style = bold] -"dlm-clone_stopped_0" -> "stonith 'on' virt-1" [ style = bold] -"dlm-clone_stopped_0" -> "stonith 'on' virt-2" [ style = bold] -"dlm-clone_stopped_0" -> "stonith 'on' virt-3" [ style = bold] "dlm-clone_stopped_0" [ style=bold color="green" fontcolor="orange"] "dlm:2_monitor_0 virt-3" -> "dlm-clone_start_0" [ style = bold] "dlm:2_monitor_0 virt-3" -> "stonith 'on' virt-3" [ style = bold] @@ -72,11 +67,13 @@ digraph "g" { "dlm_stop_0 virt-1" -> "all_stopped" [ style = bold] "dlm_stop_0 virt-1" -> "dlm-clone_stopped_0" [ style = bold] "dlm_stop_0 virt-1" -> "dlm_start_0 virt-1" [ style = bold] +"dlm_stop_0 virt-1" -> "stonith 'on' virt-1" [ style = bold] "dlm_stop_0 virt-1" [ style=bold color="green" fontcolor="black"] "dlm_stop_0 virt-2" -> "all_stopped" [ style = bold] "dlm_stop_0 virt-2" -> "dlm-clone_stopped_0" [ style = bold] "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" -> "stonith 'on' virt-2" [ style = bold] "dlm_stop_0 virt-2" [ style=bold color="green" fontcolor="black"] "fencing_monitor_0 virt-3" -> "fencing_start_0 virt-1" [ style = bold] "fencing_monitor_0 virt-3" -> "fencing_stop_0 virt-1" [ style = bold] @@ -85,14 +82,14 @@ digraph "g" { "fencing_stop_0 virt-1" -> "all_stopped" [ style = bold] "fencing_stop_0 virt-1" -> "fencing_start_0 virt-1" [ style = bold] "fencing_stop_0 virt-1" [ style=bold color="green" fontcolor="black"] -"stonith 'on' virt-1" -> "clvmd-clone_start_0" [ style = bold] -"stonith 'on' virt-1" -> "dlm-clone_start_0" [ style = bold] +"stonith 'on' virt-1" -> "clvmd_start_0 virt-1" [ style = bold] +"stonith 'on' virt-1" -> "dlm_start_0 virt-1" [ style = bold] "stonith 'on' virt-1" [ style=bold color="green" fontcolor="black"] -"stonith 'on' virt-2" -> "clvmd-clone_start_0" [ style = bold] -"stonith 'on' virt-2" -> "dlm-clone_start_0" [ style = bold] +"stonith 'on' virt-2" -> "clvmd:1_start_0 virt-2" [ style = bold] +"stonith 'on' virt-2" -> "dlm_start_0 virt-2" [ style = bold] "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" -> "clvmd:2_start_0 virt-3" [ style = bold] +"stonith 'on' virt-3" -> "dlm:2_start_0 virt-3" [ 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] diff --git a/pengine/test10/unfence-parameters.exp b/pengine/test10/unfence-parameters.exp index 48ef3bc..16aa30d 100644 --- a/pengine/test10/unfence-parameters.exp +++ b/pengine/test10/unfence-parameters.exp @@ -53,6 +53,9 @@ + + + @@ -91,6 +94,9 @@ + + + @@ -126,6 +132,9 @@ + + + @@ -204,15 +213,6 @@ - - - - - - - - - @@ -229,6 +229,9 @@ + + + @@ -264,6 +267,9 @@ + + + @@ -295,6 +301,9 @@ + + + @@ -369,15 +378,6 @@ - - - - - - - - - @@ -427,12 +427,6 @@ - - - - - - @@ -446,10 +440,7 @@ - - - - + @@ -461,10 +452,10 @@ - + - + diff --git a/pengine/test10/unfence-parameters.summary b/pengine/test10/unfence-parameters.summary index bca4f96..41fed90 100644 --- a/pengine/test10/unfence-parameters.summary +++ b/pengine/test10/unfence-parameters.summary @@ -27,25 +27,25 @@ Executing cluster transition: * Pseudo action: clvmd-clone_stop_0 * Fencing virt-4 (reboot) * Pseudo action: stonith_complete + * Fencing virt-3 (on) + * Resource action: fencing monitor on virt-3 * Resource action: clvmd stop on virt-1 * Pseudo action: clvmd-clone_stopped_0 + * Resource action: fencing stop on virt-1 * Pseudo action: dlm-clone_stop_0 * Resource action: dlm stop on virt-2 + * Fencing virt-2 (on) * Resource action: dlm stop on virt-1 * Pseudo action: dlm-clone_stopped_0 - * Fencing virt-3 (on) - * Fencing virt-2 (on) - * Fencing virt-1 (on) - * Resource action: fencing monitor on virt-3 * Pseudo action: dlm-clone_start_0 - * Resource action: fencing stop on virt-1 + * Fencing virt-1 (on) + * Pseudo action: all_stopped + * Resource action: fencing start on virt-1 * Resource action: dlm start on virt-1 * Resource action: dlm start on virt-2 * Resource action: dlm start on virt-3 * Pseudo action: dlm-clone_running_0 * Pseudo action: clvmd-clone_start_0 - * Pseudo action: all_stopped - * Resource action: fencing start on virt-1 * Resource action: clvmd start on virt-1 * Resource action: clvmd start on virt-2 * Resource action: clvmd start on virt-3 diff --git a/pengine/test10/unfence-startup.dot b/pengine/test10/unfence-startup.dot index 97eba4a..20f1367 100644 --- a/pengine/test10/unfence-startup.dot +++ b/pengine/test10/unfence-startup.dot @@ -27,8 +27,8 @@ digraph "g" { "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" [ 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" -> "clvmd:2_start_0 virt-3" [ style = bold] +"stonith 'on' virt-3" -> "dlm:2_start_0 virt-3" [ 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] diff --git a/pengine/test10/unfence-startup.exp b/pengine/test10/unfence-startup.exp index 7595cf3..569fd12 100644 --- a/pengine/test10/unfence-startup.exp +++ b/pengine/test10/unfence-startup.exp @@ -21,6 +21,9 @@ + + + @@ -60,9 +63,6 @@ - - - @@ -101,6 +101,9 @@ + + + @@ -149,9 +152,6 @@ - - - diff --git a/pengine/test10/unfence-startup.summary b/pengine/test10/unfence-startup.summary index db0f307..76bc0fc 100644 --- a/pengine/test10/unfence-startup.summary +++ b/pengine/test10/unfence-startup.summary @@ -18,6 +18,7 @@ Transition Summary: Executing cluster transition: * Resource action: dlm monitor on virt-3 + * Pseudo action: dlm-clone_start_0 * Resource action: clvmd monitor on virt-2 * Resource action: clvmd monitor on virt-3 * Fencing virt-4 (reboot) @@ -25,7 +26,6 @@ Executing cluster transition: * 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 -- 1.8.3.1 From 4a95897ab5b668f35a64e5d3818046adcafd3897 Mon Sep 17 00:00:00 2001 From: Ken Gaillot Date: Thu, 16 Jun 2016 13:49:40 -0500 Subject: [PATCH 4/4] Test: pengine: add regression test for start-then-stop + unfencing --- pengine/regression.sh | 1 + pengine/test10/start-then-stop-with-unfence.dot | 29 ++++ pengine/test10/start-then-stop-with-unfence.exp | 168 +++++++++++++++++++++ pengine/test10/start-then-stop-with-unfence.scores | 19 +++ .../test10/start-then-stop-with-unfence.summary | 42 ++++++ pengine/test10/start-then-stop-with-unfence.xml | 149 ++++++++++++++++++ 6 files changed, 408 insertions(+) create mode 100644 pengine/test10/start-then-stop-with-unfence.dot create mode 100644 pengine/test10/start-then-stop-with-unfence.exp create mode 100644 pengine/test10/start-then-stop-with-unfence.scores create mode 100644 pengine/test10/start-then-stop-with-unfence.summary create mode 100644 pengine/test10/start-then-stop-with-unfence.xml diff --git a/pengine/regression.sh b/pengine/regression.sh index f86d0f1..22ad3bf 100755 --- a/pengine/regression.sh +++ b/pengine/regression.sh @@ -534,6 +534,7 @@ do_test bug-5069-op-disabled "Test on-fail-ignore with failure when monitor is d do_test obsolete-lrm-resource "cl#5115 - Do not use obsolete lrm_resource sections" do_test expire-non-blocked-failure "Ignore failure-timeout only if the failed operation has on-fail=block" do_test asymmetrical-order-move "Respect asymmetrical ordering when trying to move resources" +do_test start-then-stop-with-unfence "Avoid graph loop with start-then-stop constraint plus unfencing" do_test ignore_stonith_rsc_order1 "cl#5056- Ignore order constraint between stonith and non-stonith rsc." do_test ignore_stonith_rsc_order2 "cl#5056- Ignore order constraint with group rsc containing mixed stonith and non-stonith." diff --git a/pengine/test10/start-then-stop-with-unfence.dot b/pengine/test10/start-then-stop-with-unfence.dot new file mode 100644 index 0000000..d8f7a71 --- /dev/null +++ b/pengine/test10/start-then-stop-with-unfence.dot @@ -0,0 +1,29 @@ +digraph "g" { +"all_stopped" [ style=bold color="green" fontcolor="orange"] +"ip1_monitor_10000 rhel7-node1.example.com" [ style=bold color="green" fontcolor="black"] +"ip1_start_0 rhel7-node1.example.com" -> "ip1_monitor_10000 rhel7-node1.example.com" [ style = bold] +"ip1_start_0 rhel7-node1.example.com" [ style=bold color="green" fontcolor="black"] +"ip1_stop_0 rhel7-node2.example.com" -> "all_stopped" [ style = bold] +"ip1_stop_0 rhel7-node2.example.com" -> "ip1_start_0 rhel7-node1.example.com" [ style = bold] +"ip1_stop_0 rhel7-node2.example.com" [ style=bold color="green" fontcolor="black"] +"jrummy-clone_running_0" -> "ip1_stop_0 rhel7-node2.example.com" [ style = bold] +"jrummy-clone_running_0" [ style=bold color="green" fontcolor="orange"] +"jrummy-clone_start_0" -> "jrummy-clone_running_0" [ style = bold] +"jrummy-clone_start_0" -> "jrummy_start_0 rhel7-node1.example.com" [ style = bold] +"jrummy-clone_start_0" [ style=bold color="green" fontcolor="orange"] +"jrummy_monitor_10000 rhel7-node1.example.com" [ style=bold color="green" fontcolor="black"] +"jrummy_start_0 rhel7-node1.example.com" -> "jrummy-clone_running_0" [ style = bold] +"jrummy_start_0 rhel7-node1.example.com" -> "jrummy_monitor_10000 rhel7-node1.example.com" [ style = bold] +"jrummy_start_0 rhel7-node1.example.com" [ style=bold color="green" fontcolor="black"] +"mpath-node1_monitor_0 rhel7-node1.example.com" -> "mpath-node1_start_0 rhel7-node1.example.com" [ style = bold] +"mpath-node1_monitor_0 rhel7-node1.example.com" [ style=bold color="green" fontcolor="black"] +"mpath-node1_monitor_60000 rhel7-node1.example.com" [ style=bold color="green" fontcolor="black"] +"mpath-node1_start_0 rhel7-node1.example.com" -> "mpath-node1_monitor_60000 rhel7-node1.example.com" [ style = bold] +"mpath-node1_start_0 rhel7-node1.example.com" [ style=bold color="green" fontcolor="black"] +"mpath-node2_monitor_0 rhel7-node1.example.com" [ style=bold color="green" fontcolor="black"] +"stonith 'on' rhel7-node1.example.com" -> "ip1_start_0 rhel7-node1.example.com" [ style = bold] +"stonith 'on' rhel7-node1.example.com" -> "jrummy_start_0 rhel7-node1.example.com" [ style = bold] +"stonith 'on' rhel7-node1.example.com" -> "mpath-node1_monitor_0 rhel7-node1.example.com" [ style = bold] +"stonith 'on' rhel7-node1.example.com" -> "mpath-node2_monitor_0 rhel7-node1.example.com" [ style = bold] +"stonith 'on' rhel7-node1.example.com" [ style=bold color="green" fontcolor="black"] +} diff --git a/pengine/test10/start-then-stop-with-unfence.exp b/pengine/test10/start-then-stop-with-unfence.exp new file mode 100644 index 0000000..aeee1fc --- /dev/null +++ b/pengine/test10/start-then-stop-with-unfence.exp @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pengine/test10/start-then-stop-with-unfence.scores b/pengine/test10/start-then-stop-with-unfence.scores new file mode 100644 index 0000000..d353bef --- /dev/null +++ b/pengine/test10/start-then-stop-with-unfence.scores @@ -0,0 +1,19 @@ +Allocation scores: +clone_color: jrummy-clone allocation score on rhel7-node1.example.com: 500 +clone_color: jrummy-clone allocation score on rhel7-node2.example.com: 500 +clone_color: jrummy:0 allocation score on rhel7-node1.example.com: 0 +clone_color: jrummy:0 allocation score on rhel7-node2.example.com: 1 +clone_color: jrummy:1 allocation score on rhel7-node1.example.com: 0 +clone_color: jrummy:1 allocation score on rhel7-node2.example.com: 0 +native_color: ip1 allocation score on rhel7-node1.example.com: 500 +native_color: ip1 allocation score on rhel7-node2.example.com: 0 +native_color: ip2 allocation score on rhel7-node1.example.com: 0 +native_color: ip2 allocation score on rhel7-node2.example.com: 500 +native_color: jrummy:0 allocation score on rhel7-node1.example.com: 0 +native_color: jrummy:0 allocation score on rhel7-node2.example.com: 1 +native_color: jrummy:1 allocation score on rhel7-node1.example.com: 0 +native_color: jrummy:1 allocation score on rhel7-node2.example.com: -INFINITY +native_color: mpath-node1 allocation score on rhel7-node1.example.com: 0 +native_color: mpath-node1 allocation score on rhel7-node2.example.com: 0 +native_color: mpath-node2 allocation score on rhel7-node1.example.com: 0 +native_color: mpath-node2 allocation score on rhel7-node2.example.com: 0 diff --git a/pengine/test10/start-then-stop-with-unfence.summary b/pengine/test10/start-then-stop-with-unfence.summary new file mode 100644 index 0000000..df7d9e3 --- /dev/null +++ b/pengine/test10/start-then-stop-with-unfence.summary @@ -0,0 +1,42 @@ + +Current cluster status: +Online: [ rhel7-node1.example.com rhel7-node2.example.com ] + + mpath-node2 (stonith:fence_mpath): Started rhel7-node2.example.com + mpath-node1 (stonith:fence_mpath): Stopped + ip1 (ocf::heartbeat:IPaddr2): Started rhel7-node2.example.com + ip2 (ocf::heartbeat:IPaddr2): Started rhel7-node2.example.com + Clone Set: jrummy-clone [jrummy] + Started: [ rhel7-node2.example.com ] + Stopped: [ rhel7-node1.example.com ] + +Transition Summary: + * Start mpath-node1 (rhel7-node1.example.com) + * Move ip1 (Started rhel7-node2.example.com -> rhel7-node1.example.com) + * Start jrummy:1 (rhel7-node1.example.com) + +Executing cluster transition: + * Pseudo action: jrummy-clone_start_0 + * Fencing rhel7-node1.example.com (on) + * Resource action: mpath-node2 monitor on rhel7-node1.example.com + * Resource action: mpath-node1 monitor on rhel7-node1.example.com + * Resource action: jrummy start on rhel7-node1.example.com + * Pseudo action: jrummy-clone_running_0 + * Resource action: mpath-node1 start on rhel7-node1.example.com + * Resource action: ip1 stop on rhel7-node2.example.com + * Resource action: jrummy monitor=10000 on rhel7-node1.example.com + * Pseudo action: all_stopped + * Resource action: mpath-node1 monitor=60000 on rhel7-node1.example.com + * Resource action: ip1 start on rhel7-node1.example.com + * Resource action: ip1 monitor=10000 on rhel7-node1.example.com + +Revised cluster status: +Online: [ rhel7-node1.example.com rhel7-node2.example.com ] + + mpath-node2 (stonith:fence_mpath): Started rhel7-node2.example.com + mpath-node1 (stonith:fence_mpath): Started rhel7-node1.example.com + ip1 (ocf::heartbeat:IPaddr2): Started rhel7-node1.example.com + ip2 (ocf::heartbeat:IPaddr2): Started rhel7-node2.example.com + Clone Set: jrummy-clone [jrummy] + Started: [ rhel7-node1.example.com rhel7-node2.example.com ] + diff --git a/pengine/test10/start-then-stop-with-unfence.xml b/pengine/test10/start-then-stop-with-unfence.xml new file mode 100644 index 0000000..499022e --- /dev/null +++ b/pengine/test10/start-then-stop-with-unfence.xml @@ -0,0 +1,149 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- 1.8.3.1