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])
----------------------------------------------------------------------
Message: 1
Date: Wed, 15 Feb 2006 06:18:47 -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:
callbacks.c
Log Message:
Debugging for 1093: lost broadcasts
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/cib/callbacks.c,v
retrieving revision 1.108
retrieving revision 1.109
diff -u -3 -r1.108 -r1.109
--- callbacks.c 14 Feb 2006 11:57:47 -0000 1.108
+++ callbacks.c 15 Feb 2006 13:18:46 -0000 1.109
@@ -1,4 +1,4 @@
-/* $Id: callbacks.c,v 1.108 2006/02/14 11:57:47 andrew Exp $ */
+/* $Id: callbacks.c,v 1.109 2006/02/15 13:18:46 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -75,7 +75,6 @@
GHashTable *ccm_membership = NULL;
extern const char *cib_our_uname;
extern ll_cluster_t *hb_conn;
-extern int set_connected_peers(crm_data_t *xml_obj);
extern unsigned long cib_num_ops, cib_num_local, cib_num_updates, cib_num_fail;
extern unsigned long cib_bad_connects, cib_num_timeouts;
extern longclock_t cib_call_time;
@@ -920,7 +919,7 @@
&diff_add_admin_epoch, &diff_add_epoch,
&diff_add_updates,
&diff_del_admin_epoch, &diff_del_epoch,
&diff_del_updates);
- crm_debug_2("Sending update diff %d.%d.%d -> %d.%d.%d",
+ crm_debug("Sending update diff %d.%d.%d -> %d.%d.%d",
diff_del_admin_epoch,diff_del_epoch,diff_del_updates,
diff_add_admin_epoch,diff_add_epoch,diff_add_updates);
@@ -1066,6 +1065,8 @@
CRM_DEV_ASSERT(result_cib != NULL);
CRM_DEV_ASSERT(current_cib != result_cib);
+ update_counters(__FILE__, __FUNCTION__, result_cib);
+
if(do_id_check(result_cib, NULL)) {
rc = cib_id_check;
if(call_options & cib_force_diff) {
@@ -1395,6 +1396,7 @@
const char *op = cl_get_string(msg, F_CIB_OPERATION);
crm_log_message_adv(LOG_MSG, "Peer[inbound]", msg);
+ crm_debug("Peer %s message (%s) from %s", op, seq, originator);
if(originator == NULL || safe_str_eq(originator, cib_our_uname)) {
crm_debug_3("Discarding %s message from ourselves", op);
------------------------------
Message: 2
Date: Wed, 15 Feb 2006 06:19:15 -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:
cibio.h io.c
Log Message:
The CCM transition was not being set correctly
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/cib/cibio.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -3 -r1.14 -r1.15
--- cibio.h 16 Jan 2006 09:16:32 -0000 1.14
+++ cibio.h 15 Feb 2006 13:19:14 -0000 1.15
@@ -1,4 +1,4 @@
-/* $Id: cibio.h,v 1.14 2006/01/16 09:16:32 andrew Exp $ */
+/* $Id: cibio.h,v 1.15 2006/02/15 13:19:14 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -55,7 +55,11 @@
extern int moveFile(const char *oldname, const char *newname,
gboolean backup, char *ext);
-extern void set_transition(crm_data_t *xml_obj);
+extern gboolean update_quorum(crm_data_t *xml_obj);
+extern gboolean set_transition(crm_data_t *xml_obj);
+extern gboolean set_connected_peers(crm_data_t *xml_obj);
+extern gboolean update_counters(
+ const char *file, const char *fn, crm_data_t *xml_obj);
/* extern crm_data_t *server_get_cib_copy(void); */
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/cib/io.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -3 -r1.46 -r1.47
--- io.c 14 Feb 2006 11:57:47 -0000 1.46
+++ io.c 15 Feb 2006 13:19:14 -0000 1.47
@@ -1,4 +1,4 @@
-/* $Id: io.c,v 1.46 2006/02/14 11:57:47 andrew Exp $ */
+/* $Id: io.c,v 1.47 2006/02/15 13:19:14 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -294,14 +294,8 @@
crm_warn("CIB Verification failed");
return FALSE;
}
-
- set_transition(new_cib);
- set_connected_peers(new_cib);
- if(cib_have_quorum) {
- crm_xml_add(new_cib, XML_ATTR_HAVE_QUORUM, XML_BOOLEAN_TRUE);
- } else {
- crm_xml_add(new_cib, XML_ATTR_HAVE_QUORUM, XML_BOOLEAN_FALSE);
- }
+
+ update_counters(__FILE__, __FUNCTION__, new_cib);
the_cib = new_cib;
initialized = TRUE;
@@ -481,25 +475,27 @@
return HA_OK;
}
-void
+gboolean
set_transition(crm_data_t *xml_obj)
{
const char *current = crm_element_value(
xml_obj, XML_ATTR_CCM_TRANSITION);
if(safe_str_neq(current, ccm_transition_id)) {
- crm_debug("Current CCM transition is: %s", ccm_transition_id);
- crm_xml_add(the_cib, XML_ATTR_CCM_TRANSITION,ccm_transition_id);
+ crm_debug("CCM transition: old=%s, new=%s",
+ current, ccm_transition_id);
+ crm_xml_add(xml_obj, XML_ATTR_CCM_TRANSITION,ccm_transition_id);
+ return TRUE;
}
+ return FALSE;
}
-int
+gboolean
set_connected_peers(crm_data_t *xml_obj)
{
int active = 0;
int current = 0;
char *peers_s = NULL;
- const char *current_s = crm_element_value(
- xml_obj, XML_ATTR_NUMPEERS);
+ const char *current_s = crm_element_value(xml_obj, XML_ATTR_NUMPEERS);
g_hash_table_foreach(peer_hash, GHFunc_count_peers, &active);
current = crm_parse_int(current_s, "0");
@@ -508,10 +504,46 @@
crm_xml_add(xml_obj, XML_ATTR_NUMPEERS, peers_s);
crm_debug("We now have %s active peers", peers_s);
crm_free(peers_s);
+ return TRUE;
+ }
+ return FALSE;
+}
+
+gboolean
+update_quorum(crm_data_t *xml_obj)
+{
+ const char *quorum_value = XML_BOOLEAN_FALSE;
+ const char *current = crm_element_value(xml_obj, XML_ATTR_HAVE_QUORUM);
+ if(cib_have_quorum) {
+ quorum_value = XML_BOOLEAN_TRUE;
+ }
+ if(safe_str_neq(current, quorum_value)) {
+ crm_debug("CCM quorum: old=%s, new=%s",
+ current, quorum_value);
+ crm_xml_add(xml_obj, XML_ATTR_HAVE_QUORUM, quorum_value);
+ return TRUE;
+ }
+ return FALSE;
+}
+
+
+gboolean
+update_counters(const char *file, const char *fn, crm_data_t *xml_obj)
+{
+ gboolean did_update = FALSE;
+
+ did_update = did_update || update_quorum(xml_obj);
+ did_update = did_update || set_transition(xml_obj);
+ did_update = did_update || set_connected_peers(xml_obj);
+
+ if(did_update) {
+ do_crm_log(LOG_DEBUG, file, fn, "Counters updated");
}
- return active;
+ return did_update;
}
+
+
void GHFunc_count_peers(gpointer key, gpointer value, gpointer user_data)
{
int *active = user_data;
------------------------------
_______________________________________________
Linux-ha-cvs mailing list
[email protected]
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs
End of Linux-ha-cvs Digest, Vol 27, Issue 65
********************************************