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: crm by andrew from
([email protected])
2. Linux-HA CVS: crm by andrew from
([email protected])
3. Linux-HA CVS: cts by andrew from
([email protected])
----------------------------------------------------------------------
Message: 1
Date: Sat, 7 Jan 2006 14:18:42 -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/cib
Modified Files:
io.c
Log Message:
Make the code fro reading the on disk configuration more obviously correct.
Log what we read from disk to avoid any later confusion.
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/cib/io.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -3 -r1.37 -r1.38
--- io.c 5 Jan 2006 17:58:41 -0000 1.37
+++ io.c 7 Jan 2006 21:18:42 -0000 1.38
@@ -1,4 +1,4 @@
-/* $Id: io.c,v 1.37 2006/01/05 17:58:41 andrew Exp $ */
+/* $Id: io.c,v 1.38 2006/01/07 21:18:42 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -112,7 +112,12 @@
{
int s_res = -1;
struct stat buf;
+
+ const char *name = NULL;
+ const char *value = NULL;
+
crm_data_t *root = NULL;
+ crm_data_t *status = NULL;
if(filename != NULL) {
s_res = stat(filename, &buf);
@@ -120,60 +125,55 @@
if (s_res == 0) {
FILE *cib_file = fopen(filename, "r");
+ crm_info("Reading cluster configuration from: %s", filename);
root = file2xml(cib_file);
crm_xml_add(root, "generated", XML_BOOLEAN_FALSE);
fclose(cib_file);
-
- if(root == NULL) {
- crm_crit("Parse ERROR reading %s.", filename);
- crm_crit("Inhibiting respawn by Heartbeat to avoid loss"
- " of configuration data.");
- sleep(3);
- exit(100);
- }
-
- } else {
- crm_warn("Stat of (%s) failed, file does not exist.",
- CIB_FILENAME);
}
- if(root != NULL) {
- int lpc = 0;
- const char *value = NULL;
- const char *name = NULL;
- crm_data_t *status = get_object_root(XML_CIB_TAG_STATUS, root);
- for (; status != NULL && lpc < status->nfields; ) {
- if(status->types[lpc] != FT_STRUCT
- && status->types[lpc] != FT_UNCOMPRESS) {
- lpc++;
- continue;
- }
-
- CRM_DEV_ASSERT(cl_msg_remove_offset(status, lpc) ==
HA_OK);
- /* dont get stuck in an infinite loop */
- if(crm_assert_failed) {
- lpc++;
- }
- }
+ if(root == NULL && s_res == 0) {
+ crm_crit("Parse ERROR reading %s.", filename);
+ crm_crit("Inhibiting respawn by Heartbeat to avoid loss"
+ " of configuration data.");
+ sleep(3); /* give the messages a little time to be logged */
+ exit(100);
- name = XML_ATTR_GENERATION_ADMIN;
- value = crm_element_value(root, name);
- if(value == NULL) {
- crm_xml_add(root, name, "0");
- }
- name = XML_ATTR_GENERATION;
- value = crm_element_value(root, name);
- if(value == NULL) {
- crm_xml_add(root, name, "0");
- }
- name = XML_ATTR_NUMUPDATES;
- value = crm_element_value(root, name);
- if(value == NULL) {
- crm_xml_add(root, name, "0");
- }
+ } else if(root == NULL) {
+ crm_warn("Cluster configuration not found: %s."
+ " Creating an empty one.", filename);
+ return NULL;
+ }
+
+ crm_log_xml_info(root, "[on-disk]");
+
+ /* strip out the status section if there is one */
+ status = find_xml_node(root, XML_CIB_TAG_STATUS, TRUE);
+ if(status != NULL) {
+ free_xml_from_parent(root, status);
+ }
+ create_xml_node(root, XML_CIB_TAG_STATUS);
- do_id_check(root, NULL);
+ /* fill in some defaults */
+ name = XML_ATTR_GENERATION_ADMIN;
+ value = crm_element_value(root, name);
+ if(value == NULL) {
+ crm_xml_add(root, name, "0");
}
+
+ name = XML_ATTR_GENERATION;
+ value = crm_element_value(root, name);
+ if(value == NULL) {
+ crm_xml_add(root, name, "0");
+ }
+
+ name = XML_ATTR_NUMUPDATES;
+ value = crm_element_value(root, name);
+ if(value == NULL) {
+ crm_xml_add(root, name, "0");
+ }
+
+ do_id_check(root, NULL);
+
if (verifyCibXml(root) == FALSE) {
free_xml(root);
root = NULL;
------------------------------
Message: 2
Date: Sat, 7 Jan 2006 14:20:01 -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:
callbacks.c control.c
Log Message:
Be stricter about when we complain about the LRM and HA disconnecting on us.
Log HA connects and disconnects
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/crmd/callbacks.c,v
retrieving revision 1.93
retrieving revision 1.94
diff -u -3 -r1.93 -r1.94
--- callbacks.c 21 Oct 2005 12:56:12 -0000 1.93
+++ callbacks.c 7 Jan 2006 21:20:01 -0000 1.94
@@ -70,7 +70,9 @@
G_main_set_trigger(fsa_source);
if (channel && (channel->ch_status != IPC_CONNECT)) {
- crm_crit("Lost connection to heartbeat service.");
+ if(is_set(fsa_input_register, R_HA_DISCONNECTED) == FALSE) {
+ crm_crit("Lost connection to heartbeat service.");
+ }
return FALSE;
}
@@ -244,16 +246,22 @@
gboolean
-lrm_dispatch(IPC_Channel*src_not_used, gpointer user_data)
+lrm_dispatch(IPC_Channel *src_not_used, gpointer user_data)
{
int num_msgs = 0;
ll_lrm_t *lrm = (ll_lrm_t*)user_data;
crm_debug_3("received callback");
num_msgs = lrm->lrm_ops->rcvmsg(lrm, FALSE);
if(num_msgs < 1) {
- crm_err("lrm->lrm_ops->rcvmsg() failed, connection lost?");
- clear_bit_inplace(fsa_input_register, R_LRM_CONNECTED);
- register_fsa_input(C_FSA_INTERNAL, I_ERROR, NULL);
+ if(is_set(fsa_input_register, R_LRM_CONNECTED)) {
+ crm_err("LRM Connection failed");
+ register_fsa_input(C_FSA_INTERNAL, I_ERROR, NULL);
+ clear_bit_inplace(fsa_input_register, R_LRM_CONNECTED);
+
+ } else {
+ crm_info("LRM Connection disconnected");
+ }
+
return FALSE;
}
return TRUE;
@@ -579,8 +587,7 @@
void
crmd_cib_connection_destroy(gpointer user_data)
{
- if(is_set(fsa_input_register, R_SHUTDOWN)
- || is_set(fsa_input_register, R_CIB_CONNECTED)) {
+ if(is_set(fsa_input_register, R_CIB_CONNECTED) == FALSE) {
crm_info("Connection to the CIB terminated...");
return;
}
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/crmd/control.c,v
retrieving revision 1.102
retrieving revision 1.103
diff -u -3 -r1.102 -r1.103
--- control.c 19 Dec 2005 16:54:43 -0000 1.102
+++ control.c 7 Jan 2006 21:20:01 -0000 1.103
@@ -62,7 +62,7 @@
fsa_cluster_conn->llc_ops->signoff(
fsa_cluster_conn, FALSE);
}
-
+ crm_info("Disconnected from Heartbeat");
}
if(action & A_HA_CONNECT) {
@@ -81,6 +81,7 @@
return I_NULL;
}
clear_bit_inplace(fsa_input_register, R_HA_DISCONNECTED);
+ crm_info("Connected to Heartbeat");
}
if(action & ~(A_HA_CONNECT|A_HA_DISCONNECT)) {
------------------------------
Message: 3
Date: Sat, 7 Jan 2006 14:21:52 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: cts by andrew from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : andrew
Host :
Project : linux-ha
Module : cts
Dir : linux-ha/cts
Modified Files:
CTSaudits.py.in
Log Message:
Differentiate between a group resource that isnt running and one thats
running on a different node to its peers.
Suppress trivial differences between CIBs
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/cts/CTSaudits.py.in,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -3 -r1.39 -r1.40
--- CTSaudits.py.in 6 Dec 2005 02:09:23 -0000 1.39
+++ CTSaudits.py.in 7 Jan 2006 21:21:51 -0000 1.40
@@ -23,7 +23,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-import time, os, popen2, string
+import time, os, popen2, string, re
import CTS
import os
import popen2
@@ -293,10 +293,14 @@
for rsc in group :
if RunningNodes != NodeofRsc[rsc.rid] :
passed = 0
- self.CM.log("Not all resources in group %s running on same
node"%
- str(group))
- self.CM.log("%s running on %s"%(group[0].rid,
NodeofRsc[group[0].rid]))
- self.CM.log("%s running on %s"%(rsc.rid,
NodeofRsc[rsc.rid]))
+ if not RunningNodes:
+ self.CM.log("Not all resources in group %s running on
same node" % repr(group))
+ self.CM.log(" %s not running" % rsc.rid)
+ else:
+ self.CM.log("Not all resources in group %s running on
same node"%
+ repr(group))
+ self.CM.log(" %s running on %s"%(group[0].rid,
NodeofRsc[group[0].rid]))
+ self.CM.log(" %s running on %s"%(rsc.rid,
NodeofRsc[rsc.rid]))
#Make sure the resouces with "must","placement" constraint are running
on the same node
Dependancies = self.CM.Dependencies()
@@ -442,9 +446,13 @@
infile, outfile, errfile = os.popen3(diff_cmd)
diff_lines = outfile.readlines()
for line in diff_lines:
- passed = 0
- self.CM.log("CibDiff[%s-%s]: %s"
- % (first_host, a_host, line))
+ if not re.search("<diff/>", line):
+ passed = 0
+ self.CM.log("CibDiff[%s-%s]: %s"
+ % (first_host, a_host, line))
+ else:
+ self.CM.debug("CibDiff[%s-%s] Ignoring: %s"
+ % (first_host, a_host, line))
diff_lines = errfile.readlines()
for line in diff_lines:
------------------------------
_______________________________________________
Linux-ha-cvs mailing list
[email protected]
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs
End of Linux-ha-cvs Digest, Vol 26, Issue 4
*******************************************