Send Linux-ha-cvs mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs
or, via email, send a message with subject or body 'help' to
[EMAIL PROTECTED]
You can reach the person managing the list at
[EMAIL PROTECTED]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Linux-ha-cvs digest..."
Today's Topics:
1. Linux-HA CVS: include by andrew from
([email protected])
2. Linux-HA CVS: crm by andrew from
([email protected])
3. Linux-HA CVS: crm by andrew from
([email protected])
4. Linux-HA CVS: crm by andrew from
([email protected])
----------------------------------------------------------------------
Message: 1
Date: Sun, 26 Mar 2006 09:03:05 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: include by andrew from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : andrew
Host :
Project : linux-ha
Module : include
Dir : linux-ha/include/crm
Modified Files:
msg_xml.h
Log Message:
More defines
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/include/crm/msg_xml.h,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -3 -r1.46 -r1.47
--- msg_xml.h 10 Jan 2006 13:46:41 -0000 1.46
+++ msg_xml.h 26 Mar 2006 16:03:05 -0000 1.47
@@ -1,4 +1,4 @@
-/* $Id: msg_xml.h,v 1.46 2006/01/10 13:46:41 andrew Exp $ */
+/* $Id: msg_xml.h,v 1.47 2006/03/26 16:03:05 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -135,6 +135,14 @@
#define XML_RSC_ATTR_MASTER_MAX "master_max"
#define XML_RSC_ATTR_MASTER_NODEMAX "master_node_max"
#define XML_RSC_ATTR_STATE "clone_state"
+#define XML_RSC_ATTR_MANAGED "is_managed"
+#define XML_RSC_ATTR_UNIQUE "globally_unique"
+#define XML_RSC_ATTR_NOTIFY "notify"
+#define XML_RSC_ATTR_STICKINESS "resource_stickiness"
+#define XML_RSC_ATTR_FAIL_STICKINESS "resource_failure_stickiness"
+#define XML_RSC_ATTR_MULTIPLE "multiple_active"
+#define XML_RSC_ATTR_START "start_prereq"
+#define XML_RSC_ATTR_PRIORITY "priority"
#define XML_CIB_TAG_LRM "lrm"
#define XML_LRM_TAG_RESOURCES "lrm_resources"
------------------------------
Message: 2
Date: Sun, 26 Mar 2006 09:04:50 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: crm by andrew from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : andrew
Host :
Project : linux-ha
Module : crm
Dir : linux-ha/crm/pengine
Modified Files:
complex.c
Log Message:
Use the #define equivalents
Include failure stickiness in the list of allowed instance_attributes
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/pengine/complex.c,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -3 -r1.74 -r1.75
--- complex.c 18 Mar 2006 17:23:48 -0000 1.74
+++ complex.c 26 Mar 2006 16:04:50 -0000 1.75
@@ -1,4 +1,4 @@
-/* $Id: complex.c,v 1.74 2006/03/18 17:23:48 andrew Exp $ */
+/* $Id: complex.c,v 1.75 2006/03/26 16:04:50 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -178,19 +178,21 @@
XML_RSC_ATTR_INCARNATION_NODEMAX,
XML_RSC_ATTR_MASTER_MAX,
XML_RSC_ATTR_MASTER_NODEMAX,
- "resource_stickiness"
+ XML_RSC_ATTR_STICKINESS,
+ XML_RSC_ATTR_FAIL_STICKINESS,
};
const char *rsc_attrs[] = {
XML_RSC_ATTR_STOPFAIL,
XML_RSC_ATTR_RESTART,
- "resource_stickiness",
- "resource_failure_stickiness",
- "multiple_active",
- "start_prereq",
- "is_managed",
- "globally_unique",
- "notify"
+ XML_RSC_ATTR_MANAGED,
+ XML_RSC_ATTR_UNIQUE,
+ XML_RSC_ATTR_NOTIFY,
+ XML_RSC_ATTR_MULTIPLE,
+ XML_RSC_ATTR_START,
+#if CRM_DEPRECATED_SINCE_2_0_4
+ XML_RSC_ATTR_STICKINESS,
+#endif
};
crm_log_xml_debug_3(xml_obj, "Processing resource input...");
------------------------------
Message: 3
Date: Sun, 26 Mar 2006 09:53:13 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: crm by andrew from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : andrew
Host :
Project : linux-ha
Module : crm
Dir : linux-ha/crm/pengine/testcases
Modified Files:
994.dot 994.xml
Log Message:
Fix up 994
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/pengine/testcases/994.dot,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- 994.dot 17 Dec 2005 08:56:37 -0000 1.1
+++ 994.dot 26 Mar 2006 16:53:13 -0000 1.2
@@ -4,7 +4,6 @@
"group_1:postfix_9_monitor_0 <none>" [ style="dashed" color="blue"
fontcolor="black" ]
"group_1:postfix_9_monitor_120000 paul" [ style=bold color="green"
fontcolor="black" ]
"group_1:postfix_9_stop_0 paul" [ style=bold color="green" fontcolor="black" ]
-"group_1:datadisk_1_monitor_0 <none>" [ style="dashed" color="blue"
fontcolor="black" ]
"group_1:datadisk_1_monitor_120000 paul" [ style="dashed" color="blue"
fontcolor="black" ]
"group_1:IPaddr_5_monitor_5000 paul" [ style="dashed" color="blue"
fontcolor="black" ]
"group_1:datadisk_1_stop_0 paul" [ style="dashed" color="blue"
fontcolor="black" ]
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/pengine/testcases/994.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- 994.xml 26 Mar 2006 15:58:52 -0000 1.2
+++ 994.xml 26 Mar 2006 16:53:13 -0000 1.3
@@ -92,7 +92,7 @@
</lrm_resource>
<lrm_resource id="group_1:IPaddr_5" type="IPaddr" class="ocf"
provider="heartbeat" rsc_state="starting">
<lrm_rsc_op id="group_1:IPaddr_5_monitor_0" operation="monitor"
origin="do_update_resource"
transition_key="0:b12c0a28-1ba5-407b-945c-e4d5ea1602dc"
transition_magic="0:7;0:b12c0a28-1ba5-407b-945c-e4d5ea1602dc"
rsc_state="running" call_id="4" rc_code="7" op_status="0">
- <parameters ip="10.10.10.222" timeout="20000" te-target-rc="7"
lrm-is-probe="true" crm_feature_set="1.0.3"/>
+ <parameters ip="10.10.10.222" te-target-rc="7"
lrm-is-probe="true" crm_feature_set="1.0.3"/>
</lrm_rsc_op>
<lrm_rsc_op id="group_1:IPaddr_5_start_0" operation="start"
op_status="0" call_id="12" rc_code="0" origin="do_update_resource"
transition_key="2:b12c0a28-1ba5-407b-945c-e4d5ea1602dc"
transition_magic="0:0;2:b12c0a28-1ba5-407b-945c-e4d5ea1602dc"
rsc_state="running">
<parameters ip="10.10.10.222" crm_feature_set="1.0.3"/>
------------------------------
Message: 4
Date: Sun, 26 Mar 2006 09:54:10 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: crm by andrew from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : andrew
Host :
Project : linux-ha
Module : crm
Dir : linux-ha/crm/pengine
Modified Files:
unpack.c
Log Message:
Abstract out the checking of action parameters
Check action parameters in the correct circumstances
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/pengine/unpack.c,v
retrieving revision 1.167
retrieving revision 1.168
diff -u -3 -r1.167 -r1.168
--- unpack.c 21 Mar 2006 20:40:14 -0000 1.167
+++ unpack.c 26 Mar 2006 16:54:09 -0000 1.168
@@ -1,4 +1,4 @@
-/* $Id: unpack.c,v 1.167 2006/03/21 20:40:14 andrew Exp $ */
+/* $Id: unpack.c,v 1.168 2006/03/26 16:54:09 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -128,12 +128,12 @@
crm_debug("%s set to: %s",
"transition_idle_timeout", data_set->transition_idle_timeout);
- get_cluster_pref("default_resource_stickiness");
+ get_cluster_pref("default_"XML_RSC_ATTR_STICKINESS);
data_set->default_resource_stickiness = char2score(value);
crm_info("Default stickiness: %d",
data_set->default_resource_stickiness);
- get_cluster_pref("default_resource_failure_stickiness");
+ get_cluster_pref("default_"XML_RSC_ATTR_FAIL_STICKINESS);
data_set->default_resource_fail_stickiness = char2score(value);
crm_info("Default failure stickiness: %d",
data_set->default_resource_fail_stickiness);
@@ -1126,9 +1126,106 @@
CRM_CHECK(FALSE, sort_return(0));
}
+static gboolean
+check_action_definition(resource_t *rsc, node_t *node, crm_data_t *xml_op,
+ pe_working_set_t *data_set)
+{
+ int lpc = 0;
+ gboolean did_change = FALSE;
+
+ crm_data_t *pnow = NULL;
+ crm_data_t *pdiff = NULL;
+ GHashTable *local_rsc_params = NULL;
+
+ const char *id = ID(xml_op);
+ const char *task = crm_element_value(xml_op, XML_LRM_ATTR_TASK);
+ action_t *action = custom_action(rsc, crm_strdup(id), task, node,
+ TRUE, FALSE, data_set);
+
+ crm_data_t *params = find_xml_node(xml_op, XML_TAG_PARAMS, TRUE);
+
+
+ const char *attr_filter[] = {
+ XML_ATTR_TE_TARGET_RC,
+ XML_ATTR_LRM_PROBE,
+ XML_RSC_ATTR_START,
+ XML_RSC_ATTR_NOTIFY,
+ XML_RSC_ATTR_UNIQUE,
+ XML_RSC_ATTR_MANAGED,
+ XML_ATTR_CRM_VERSION,
+ XML_RSC_ATTR_PRIORITY,
+ XML_RSC_ATTR_MULTIPLE,
+ XML_RSC_ATTR_STICKINESS,
+ XML_RSC_ATTR_FAIL_STICKINESS,
+
+/* ignore clone fields */
+ XML_RSC_ATTR_INCARNATION,
+ XML_RSC_ATTR_INCARNATION_MAX,
+ XML_RSC_ATTR_INCARNATION_NODEMAX,
+ XML_RSC_ATTR_MASTER_MAX,
+ XML_RSC_ATTR_MASTER_NODEMAX,
+
+/* ignore notify fields */
+ "notify_stop_resource",
+ "notify_stop_uname",
+ "notify_start_resource",
+ "notify_start_uname",
+ "notify_active_resource",
+ "notify_active_uname",
+ "notify_inactive_resource",
+ "notify_inactive_uname",
+ "notify_promote_resource",
+ "notify_promote_uname",
+ "notify_demote_resource",
+ "notify_demote_uname",
+ "notify_master_resource",
+ "notify_master_uname",
+ "notify_slave_resource",
+ "notify_slave_uname",
+ };
+
+ local_rsc_params = g_hash_table_new_full(
+ g_str_hash, g_str_equal,
+ g_hash_destroy_str, g_hash_destroy_str);
+
+ unpack_instance_attributes(
+ rsc->xml, XML_TAG_ATTR_SETS, node, local_rsc_params,
+ NULL, 0, data_set);
+
+ pnow = create_xml_node(NULL, XML_TAG_PARAMS);
+ g_hash_table_foreach(action->extra, hash2field, pnow);
+ g_hash_table_foreach(rsc->parameters, hash2field, pnow);
+ g_hash_table_foreach(local_rsc_params, hash2field, pnow);
+
+ for(lpc = 0; lpc < DIMOF(attr_filter); lpc++) {
+ xml_remove_prop(pnow, attr_filter[lpc]);
+ xml_remove_prop(params, attr_filter[lpc]);
+ }
+
+ pdiff = diff_xml_object(params, pnow, TRUE);
+ if(pdiff != NULL) {
+ did_change = TRUE;
+ crm_info("Parameters to %s action changed", id);
+ log_xml_diff(LOG_INFO, pdiff, __FUNCTION__);
+ custom_action(rsc, crm_strdup(id), task, NULL,
+ FALSE, TRUE, data_set);
+ }
+
+ g_hash_table_destroy(action->extra);
+ crm_free(action->uuid);
+ crm_free(action);
+ free_xml(pnow);
+ free_xml(pdiff);
+
+ g_hash_table_destroy(local_rsc_params);
+
+ return did_change;
+}
+
gboolean
unpack_rsc_op(resource_t *rsc, node_t *node, crm_data_t *xml_op,
- int *max_call_id, enum action_fail_response *on_fail,
pe_working_set_t *data_set)
+ int *max_call_id, enum action_fail_response *on_fail,
+ pe_working_set_t *data_set)
{
const char *id = NULL;
const char *task = NULL;
@@ -1151,7 +1248,7 @@
CRM_CHECK(rsc != NULL, return FALSE);
CRM_CHECK(node != NULL, return FALSE);
CRM_CHECK(xml_op != NULL, return FALSE);
-
+
id = ID(xml_op);
task = crm_element_value(xml_op, XML_LRM_ATTR_TASK);
task_id = crm_element_value(xml_op, XML_LRM_ATTR_CALLID);
@@ -1182,44 +1279,52 @@
}
}
- if(params == NULL) {
+ if(rsc->orphan) {
+ crm_debug_2("Skipping param check for orphan: %s %s", rsc->id,
task);
+
+ } else if(safe_str_eq(task, CRMD_ACTION_STOP)) {
+ crm_debug_2("Ignoring stop params: %s", id);
- } else if(safe_str_eq(task, CRMD_ACTION_STATUS) && interval == 0) {
- /* ignore probes */
+ } else if(params == NULL) {
+ /* for older test cases */
+ crm_err("Skipping param check: %s %s", id, task);
+
+ } else if((interval == 0 && safe_str_eq(task, CRMD_ACTION_STATUS))
+ || safe_str_eq(task, CRMD_ACTION_START)) {
+ crm_debug_2("Checking resource definition: %s", rsc->id);
+ check_action_definition(rsc, node, xml_op, data_set);
- } else if(rsc->orphan == FALSE || data_set->stop_rsc_orphans == FALSE){
+ } else if(interval > 0 && data_set->stop_action_orphans) {
crm_data_t *op_match = NULL;
- crm_data_t *pdiff = NULL;
- GHashTable *local_rsc_params = NULL;
- crm_data_t *pnow = NULL;
- crm_debug_2("Checking parameters to %s action", task);
+ crm_debug_2("Checking parameters for %s %s", id, task);
xml_child_iter_filter(
rsc->ops_xml, operation, "op",
- const char *name = crm_element_value(operation, "name");
- int value = crm_get_msec(
+ int value = 0;
+ const char *name = NULL;
+
+ value = crm_get_msec(
crm_element_value(operation, "interval"));
+
if(interval <= 0) {
break;
- } else if(safe_str_neq(name, task)) {
+ } else if(value != interval) {
continue;
+ }
- } else if(value != interval) {
+ name = crm_element_value(operation, "name");
+ if(safe_str_neq(name, task)) {
continue;
}
+
op_match = operation;
);
- if(interval > 0 && op_match == NULL) {
- if(data_set->stop_action_orphans == FALSE) {
- /* create a cancel action */
- pe_config_warn("Ignoring orphan action: %s",
id);
- return TRUE;
- }
-
+ if(op_match == NULL && interval > 0 &&
data_set->stop_action_orphans) {
+ /* create a cancel action */
pe_config_warn("Orphan action will be stopped: %s", id);
action = custom_action(
@@ -1234,63 +1339,12 @@
rsc, stop_key(rsc), NULL,
pe_ordering_optional, data_set);
- return TRUE;
- }
+ } else if(op_match == NULL && interval > 0) {
+ pe_config_warn("Ignoring orphan action: %s", id);
- action = custom_action(rsc, crm_strdup(id), task, node,
- TRUE, FALSE, data_set);
-
- local_rsc_params = g_hash_table_new_full(
- g_str_hash, g_str_equal,
- g_hash_destroy_str, g_hash_destroy_str);
-
- unpack_instance_attributes(
- rsc->xml, XML_TAG_ATTR_SETS, node, local_rsc_params,
- NULL, 0, data_set);
-
- pnow = create_xml_node(NULL, XML_TAG_PARAMS);
- g_hash_table_foreach(action->extra, hash2field, pnow);
- g_hash_table_foreach(rsc->parameters, hash2field, pnow);
- g_hash_table_foreach(local_rsc_params, hash2field, pnow);
- xml_remove_prop(pnow, XML_ATTR_CRM_VERSION);
- xml_remove_prop(params, XML_ATTR_CRM_VERSION);
- xml_remove_prop(pnow, "is_managed");
- xml_remove_prop(params, "is_managed");
-
- /* ignore notify fields */
- xml_remove_prop(params, "notify_stop_resource");
- xml_remove_prop(params, "notify_stop_uname");
- xml_remove_prop(params, "notify_start_resource");
- xml_remove_prop(params, "notify_start_uname");
- xml_remove_prop(params, "notify_active_resource");
- xml_remove_prop(params, "notify_active_uname");
- xml_remove_prop(params, "notify_inactive_resource");
- xml_remove_prop(params, "notify_inactive_uname");
- xml_remove_prop(params, "notify_promote_resource");
- xml_remove_prop(params, "notify_promote_uname");
- xml_remove_prop(params, "notify_demote_resource");
- xml_remove_prop(params, "notify_demote_uname");
- xml_remove_prop(params, "notify_master_resource");
- xml_remove_prop(params, "notify_master_uname");
- xml_remove_prop(params, "notify_slave_resource");
- xml_remove_prop(params, "notify_slave_uname");
-
- pdiff = diff_xml_object(params, pnow, TRUE);
- if(pdiff != NULL) {
- crm_info("Parameters to %s action changed", id);
- log_xml_diff(LOG_INFO, pdiff, __FUNCTION__);
-
- custom_action(rsc, crm_strdup(id), task, NULL,
- FALSE, TRUE, data_set);
- }
-
- g_hash_table_destroy(action->extra);
- crm_free(action->uuid);
- crm_free(action);
- free_xml(pnow);
- free_xml(pdiff);
- g_hash_table_destroy(local_rsc_params);
- action = NULL;
+ } else {
+ check_action_definition(rsc, node, xml_op, data_set);
+ }
}
if(safe_str_eq(task, CRMD_ACTION_STOP)) {
@@ -1365,6 +1419,7 @@
rsc->role = RSC_ROLE_STARTED;
crm_info("%s: resource %s is active on %s",
id, rsc->id, node->details->uname);
+ crm_log_xml_debug_2(xml_op, "op");
return TRUE;
}
------------------------------
_______________________________________________
Linux-ha-cvs mailing list
[email protected]
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs
End of Linux-ha-cvs Digest, Vol 28, Issue 62
********************************************