File bug-914761_pacemaker-pengine-not-reschedule-unneeded-monitor.patch of Package pacemaker.9287

commit 694a3f0b2e1a870b26dd748aa03b3d152c55c2cc
Author: Gao,Yan <ygao@suse.com>
Date:   Wed Feb 25 14:05:14 2015 +0100

    Fix: pengine: Do not reschedule monitors that are no longer needed while resource definitions have changed

diff --git a/include/crm/pengine/status.h b/include/crm/pengine/status.h
index da20f64..3c4a734 100644
--- a/include/crm/pengine/status.h
+++ b/include/crm/pengine/status.h
@@ -183,6 +183,7 @@ struct node_s {
 
 #  define pe_rsc_try_reload     0x00001000ULL
 #  define pe_rsc_reload         0x00002000ULL
+#  define pe_rsc_reschedule_monitor 0x00004000ULL
 
 #  define pe_rsc_failed		0x00010000ULL
 #  define pe_rsc_shutdown	0x00020000ULL
diff --git a/pengine/allocate.c b/pengine/allocate.c
index 0994a87..999b4e6 100644
--- a/pengine/allocate.c
+++ b/pengine/allocate.c
@@ -274,17 +274,15 @@ check_action_definition(resource_t * rsc, node_t * active_node, xmlNode * xml_op
                  crm_element_value(xml_op, XML_ATTR_TRANSITION_MAGIC));
 
         if (interval > 0) {
+#if 0
             action_t *op = NULL;
 
-#if 0
             /* Always reload/restart the entire resource */
             op = custom_action(rsc, start_key(rsc), RSC_START, NULL, FALSE, TRUE, data_set);
             update_action_flags(op, pe_action_allow_reload_conversion);
 #else
             /* Re-sending the recurring op is sufficient - the old one will be cancelled automatically */
-            op = custom_action(rsc, key, task, NULL, FALSE, TRUE, data_set);
-            custom_action_order(rsc, start_key(rsc), NULL,
-                                NULL, NULL, op, pe_order_runnable_left, data_set);
+            set_bit(rsc->flags, pe_rsc_reschedule_monitor);
 #endif
 
         } else if (digest_restart) {
diff --git a/pengine/native.c b/pengine/native.c
index 3f1807e..46cf01e 100644
--- a/pengine/native.c
+++ b/pengine/native.c
@@ -725,6 +725,10 @@ RecurringOp(resource_t * rsc, action_t * start, node_t * node,
     if (possible_matches == NULL) {
         is_optional = FALSE;
         pe_rsc_trace(rsc, "Marking %s manditory: not active", key);
+
+    } else if (is_set(rsc->flags, pe_rsc_reschedule_monitor)) {
+        is_optional = FALSE;
+
     } else {
         g_list_free(possible_matches);
     }
openSUSE Build Service is sponsored by