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: lib by andrew from
([email protected])
3. Linux-HA CVS: crm by andrew from
([email protected])
----------------------------------------------------------------------
Message: 1
Date: Fri, 31 Mar 2006 04:50:26 -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 crm.h
Log Message:
Code for calculating xml digests is now in the common library
When calculating a digest, sort the top-level fields
- required when creating the hash of an operations parameters
Standardized on one debug attribute and always ignore it in diffs
Removed timestamp code that did nothing anyway, we haven't wanted
to add this to every field for a long time
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/include/crm/msg_xml.h,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -3 -r1.47 -r1.48
--- msg_xml.h 26 Mar 2006 16:03:05 -0000 1.47
+++ msg_xml.h 31 Mar 2006 11:50:24 -0000 1.48
@@ -1,4 +1,4 @@
-/* $Id: msg_xml.h,v 1.47 2006/03/26 16:03:05 andrew Exp $ */
+/* $Id: msg_xml.h,v 1.48 2006/03/31 11:50:24 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -33,6 +33,7 @@
#define F_CRM_ELECTION_OWNER "election-owner"
/*---- Common tags/attrs */
+#define XML_DIFF_MARKER "__crm_diff_marker__"
#define XML_ATTR_TAGNAME F_XML_TAGNAME
#define XML_ATTR_PARENT F_XML_PARENT
#define XML_TAG_CIB "cib"
@@ -47,7 +48,9 @@
#define XML_ATTR_GENERATION_ADMIN "admin_epoch"
#define XML_ATTR_NUMUPDATES "num_updates"
#define XML_ATTR_TIMEOUT "timeout"
-#define XML_ATTR_TSTAMP "timestamp"
+#define XML_ATTR_ORIGIN "crm-debug-origin"
+#define XML_ATTR_TSTAMP "crm-timestamp"
+#define XML_CIB_ATTR_WRITTEN "cib-last-written"
#define XML_ATTR_VERSION "version"
#define XML_ATTR_DESC "description"
#define XML_ATTR_ID "id"
@@ -181,6 +184,7 @@
#define XML_LRM_ATTR_OPSTATUS "op_status"
#define XML_LRM_ATTR_RC "rc_code"
#define XML_LRM_ATTR_CALLID "call_id"
+#define XML_LRM_ATTR_OP_DIGEST "op_digest"
#define XML_TAG_GRAPH "transition_graph"
#define XML_GRAPH_TAG_RSC_OP "rsc_op"
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/include/crm/crm.h,v
retrieving revision 1.89
retrieving revision 1.90
diff -u -3 -r1.89 -r1.90
--- crm.h 26 Mar 2006 16:02:29 -0000 1.89
+++ crm.h 31 Mar 2006 11:50:24 -0000 1.90
@@ -1,4 +1,4 @@
-/* $Id: crm.h,v 1.89 2006/03/26 16:02:29 andrew Exp $ */
+/* $Id: crm.h,v 1.90 2006/03/31 11:50:24 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -43,6 +43,7 @@
#define CRM_DEPRECATED_SINCE_2_0_2 1
#define CRM_DEPRECATED_SINCE_2_0_3 1
#define CRM_DEPRECATED_SINCE_2_0_4 1
+#define CRM_DEPRECATED_SINCE_2_0_5 1
#define CRM_DEPRECATED_SINCE_2_1_0 1
#define ipc_call_diff_max_ms 5000
@@ -213,17 +214,16 @@
#define crm_debug(fmt...) crm_log_maybe(LOG_DEBUG, fmt)
#define crm_debug_2(fmt...) crm_log_maybe(LOG_DEBUG_2, fmt)
+#define crm_debug_3(fmt...) crm_log_maybe(LOG_DEBUG_3, fmt)
/* If this is not a developmental build, give the compiler every chance to
* optimize these away
*/
#if CRM_DEV_BUILD
-# define crm_debug_3(fmt...) crm_log_maybe(LOG_DEBUG_3, fmt)
# define crm_debug_4(fmt...) crm_log_maybe(LOG_DEBUG_4, fmt)
# define crm_debug_5(fmt...) crm_log_maybe(LOG_DEBUG_5, fmt)
# define crm_debug_6(fmt...) crm_log_maybe(LOG_DEBUG_6, fmt)
#else
-# define crm_debug_3(w...) if(0) { do_crm_log(LOG_DEBUG, NULL, NULL, w); }
# define crm_debug_4(w...) if(0) { do_crm_log(LOG_DEBUG, NULL, NULL, w); }
# define crm_debug_5(w...) if(0) { do_crm_log(LOG_DEBUG, NULL, NULL, w); }
# define crm_debug_6(w...) if(0) { do_crm_log(LOG_DEBUG, NULL, NULL, w); }
------------------------------
Message: 2
Date: Fri, 31 Mar 2006 04:58:18 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: lib by andrew from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : andrew
Host :
Project : linux-ha
Module : lib
Dir : linux-ha/lib/crm/common
Modified Files:
utils.c
Log Message:
Move the failcount updating code to the TE which already has to figure out
parse the event and check the desired rc-code.
Have the CRMd send back a digest of the parameters used for an operation
- this makes the status section smaller and verifyable with a DTD
Put the code for filtering out operation parameters into a common library
where the CRMd can call it *before* creating the op_digest
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/lib/crm/common/utils.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -3 -r1.37 -r1.38
--- utils.c 27 Mar 2006 14:54:59 -0000 1.37
+++ utils.c 31 Mar 2006 11:58:17 -0000 1.38
@@ -1,4 +1,4 @@
-/* $Id: utils.c,v 1.37 2006/03/27 14:54:59 andrew Exp $ */
+/* $Id: utils.c,v 1.38 2006/03/31 11:58:17 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -1132,6 +1132,58 @@
return TRUE;
}
+void
+filter_action_parameters(crm_data_t *param_set)
+{
+ const char *attr_filter[] = {
+ XML_LRM_ATTR_OP_DIGEST,
+ 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 master fields */
+ "crm_role",
+
+/* 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",
+ };
+
+ int lpc = 0;
+
+ for(lpc = 0; lpc < DIMOF(attr_filter); lpc++) {
+ xml_remove_prop(param_set, attr_filter[lpc]);
+ }
+}
gboolean
crm_mem_stats(volatile cl_mem_stats_t *mem_stats)
------------------------------
Message: 3
Date: Fri, 31 Mar 2006 04:58:17 -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/crmd
Modified Files:
lrm.c
Log Message:
Move the failcount updating code to the TE which already has to figure out
parse the event and check the desired rc-code.
Have the CRMd send back a digest of the parameters used for an operation
- this makes the status section smaller and verifyable with a DTD
Put the code for filtering out operation parameters into a common library
where the CRMd can call it *before* creating the op_digest
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/crmd/lrm.c,v
retrieving revision 1.175
retrieving revision 1.176
diff -u -3 -r1.175 -r1.176
--- lrm.c 28 Mar 2006 13:06:08 -0000 1.175
+++ lrm.c 31 Mar 2006 11:58:17 -0000 1.176
@@ -410,7 +410,7 @@
crm_free(op_id);
crm_xml_add(xml_op, XML_LRM_ATTR_TASK, op->op_type);
- crm_xml_add(xml_op, "origin", src);
+ crm_xml_add(xml_op, XML_ATTR_ORIGIN, src);
if(op->user_data == NULL) {
op->user_data = generate_transition_key(-1, fsa_our_uname);
@@ -444,8 +444,9 @@
case LRM_OP_ERROR:
case LRM_OP_TIMEOUT:
case LRM_OP_NOTSUPPORTED:
- crm_debug("Resource action %s/%s failed: %d",
- op->rsc_id, op->op_type, op->op_status);
+ crm_debug("Resource action %s/%s %s: %d",
+ op->rsc_id, op->op_type,
+ op_status2text(op->op_status), op->rc);
len = strlen(op->op_type);
len += strlen("_failed_");
crm_malloc0(fail_state, sizeof(char)*len);
@@ -489,8 +490,6 @@
crm_xml_add(xml_op, XML_LRM_ATTR_OPSTATUS, tmp);
crm_free(tmp);
- set_node_tstamp(xml_op);
-#if 1
if(safe_str_neq(op->op_type, CRMD_ACTION_STOP)) {
/* this will enable us to later determin that the
* resource's parameters have changed and we should force
@@ -499,10 +498,21 @@
* larger CIB
*/
crm_data_t *args_xml = NULL;
+ char *digest = NULL;
+#if CRM_DEPRECATED_SINCE_2_0_4
args_xml = create_xml_node(xml_op, XML_TAG_PARAMS);
+#else
+ args_xml = create_xml_node(NULL, XML_TAG_PARAMS);
+#endif
g_hash_table_foreach(op->params, hash2field, args_xml);
- }
+ filter_action_parameters(args_xml);
+ digest = calculate_xml_digest(args_xml);
+ crm_xml_add(xml_op, XML_LRM_ATTR_OP_DIGEST, digest);
+#if CRM_DEPRECATED_SINCE_2_0_4
+#else
+ free_xml(args_xml);
#endif
+ }
return TRUE;
}
@@ -1333,67 +1343,6 @@
return rsc_copy;
}
-static void
-update_failcount(lrm_op_t *op)
-{
- int op_status = LRM_OP_DONE;
- const char *target_rc_s = NULL;
-
- CRM_DEV_ASSERT(op != NULL);
-
- if(op->interval <= 0) {
- return;
- }
-/*
- const char *probe_s = NULL;
- probe_s = g_hash_table_lookup(op->params, XML_ATTR_LRM_PROBE);
- if(crm_is_true(probe_s)) {
- return;
- }
-*/
- CRM_DEV_ASSERT(op->op_status != LRM_OP_PENDING);
- if(crm_assert_failed) {
- return;
- }
-
- CRM_DEV_ASSERT(op->op_status != LRM_OP_DONE);
- if(crm_assert_failed) {
- return;
- }
-
- op_status = op->op_status;
- target_rc_s = g_hash_table_lookup(op->params, XML_ATTR_TE_TARGET_RC);
-
- if(target_rc_s != NULL) {
- int target_rc = crm_parse_int(target_rc_s, NULL);
- if(target_rc == op->rc) {
- if(op_status != LRM_OP_DONE) {
- op_status = LRM_OP_DONE;
- }
-
- } else if(op_status != LRM_OP_ERROR) {
- op_status = LRM_OP_ERROR;
- }
- }
-
- if(op_status != LRM_OP_DONE) {
- char *attr_set = crm_concat("crmd-transient",fsa_our_uuid, '-');
- char *attr_name = crm_concat("fail-count", op->rsc_id, '-');
- char *attr_id = crm_concat(attr_name, fsa_our_uuid, '-');
-
- crm_warn("Updating failcount for %s after failed %s: rc=%d",
- op->rsc_id, op->op_type, op->rc);
-
- update_attr(fsa_cib_conn, cib_none, XML_CIB_TAG_STATUS,
- fsa_our_uuid, attr_set, attr_id, attr_name,
- XML_NVPAIR_ATTR_VALUE"++");
-
- crm_free(attr_id);
- crm_free(attr_set);
- crm_free(attr_name);
- }
-}
-
void
do_update_resource(lrm_op_t* op)
{
@@ -1486,7 +1435,6 @@
const char *probe_s = NULL;
gboolean is_probe = FALSE;
int log_rsc_err = LOG_WARNING;
- gboolean set_failcount = FALSE;
if(msg_data->fsa_cause != C_LRM_OP_CALLBACK) {
register_fsa_error(C_FSA_INTERNAL, I_FAIL, NULL);
@@ -1516,8 +1464,6 @@
case LRM_OP_ERROR:
if(is_probe) {
log_rsc_err = LOG_INFO;
- } else {
- set_failcount = TRUE;
}
crm_log_maybe(log_rsc_err,
"LRM operation (%d) %s_%d on %s %s: (%d)
%s",
@@ -1539,7 +1485,6 @@
return I_NULL;
break;
case LRM_OP_TIMEOUT:
- set_failcount = TRUE;
last_op = g_hash_table_lookup(
resources_confirmed, crm_strdup(op->rsc_id));
@@ -1558,7 +1503,6 @@
op_status2text(op->op_status));
break;
case LRM_OP_NOTSUPPORTED:
- set_failcount = TRUE;
crm_err("LRM operation (%d) %s_%d on %s %s",
op->call_id, op->op_type,
op->interval,
@@ -1578,10 +1522,6 @@
do_update_resource(op);
- if(set_failcount) {
- update_failcount(op);
- }
-
if(g_hash_table_size(shutdown_ops) > 0) {
char *op_id = make_stop_id(op->rsc_id, op->call_id);
if(g_hash_table_remove(shutdown_ops, op_id)) {
------------------------------
_______________________________________________
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 87
********************************************