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: Thu, 20 Apr 2006 09:43:23 -0600 (MDT)
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 messages.c
Log Message:
When autojoin is enabled the CCM likes to give us memberships like this:
NEW MEMBERSHIP: trans=2, nodes=1, new=1, lost=1 n_idx=0, new_idx=1, old_idx=3
CURRENT: c001n05 [nodeid=1, born=2]
NEW: c001n05 [nodeid=1, born=2]
LOST: c001n05 [nodeid=0, born=1]
So, update the CIB with lost members and then the new members so n05 doesnt
appear to be offline.
Also, check the node really left before removing it from lists and starting
elections because the DC "left"
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/cib/messages.c,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -3 -r1.74 -r1.75
--- messages.c 10 Apr 2006 13:01:21 -0000 1.74
+++ messages.c 20 Apr 2006 15:43:23 -0000 1.75
@@ -1,4 +1,4 @@
-/* $Id: messages.c,v 1.74 2006/04/10 13:01:21 andrew Exp $ */
+/* $Id: messages.c,v 1.75 2006/04/20 15:43:23 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -747,18 +747,18 @@
return cib_ok;
}
-#define cib_update_xml_macro(parent, xml_update)
\
+#define cib_update_xml_macro(parent, xml_update) \
if(operation == CIB_UPDATE_OP_DELETE) { \
rc = delete_cib_object(parent, xml_update); \
- update_results(failed, xml_update, operation, rc);
\
+ update_results(failed, xml_update, operation, rc); \
\
} else if(operation == CIB_UPDATE_OP_MODIFY) { \
rc = update_cib_object(parent, xml_update); \
- update_results(failed, xml_update, operation, rc);
\
+ update_results(failed, xml_update, operation, rc); \
\
} else { \
rc = add_cib_object(parent, xml_update); \
- update_results(failed, xml_update, operation, rc);
\
+ update_results(failed, xml_update, operation, rc); \
}
enum cib_errors
------------------------------
Message: 2
Date: Thu, 20 Apr 2006 09:43:24 -0600 (MDT)
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 ccm.c
Log Message:
When autojoin is enabled the CCM likes to give us memberships like this:
NEW MEMBERSHIP: trans=2, nodes=1, new=1, lost=1 n_idx=0, new_idx=1, old_idx=3
CURRENT: c001n05 [nodeid=1, born=2]
NEW: c001n05 [nodeid=1, born=2]
LOST: c001n05 [nodeid=0, born=1]
So, update the CIB with lost members and then the new members so n05 doesnt
appear to be offline.
Also, check the node really left before removing it from lists and starting
elections because the DC "left"
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/crmd/callbacks.c,v
retrieving revision 1.117
retrieving revision 1.118
diff -u -3 -r1.117 -r1.118
--- callbacks.c 19 Apr 2006 16:24:55 -0000 1.117
+++ callbacks.c 20 Apr 2006 15:43:23 -0000 1.118
@@ -368,8 +368,7 @@
unget_uuid(node);
}
- if(safe_str_eq(node, fsa_our_dc)
- && safe_str_eq(status, OFFLINESTATUS)) {
+ if(safe_str_eq(node, fsa_our_dc) && safe_str_eq(status, OFFLINESTATUS)){
/* did our DC leave us */
crm_info("Got client status callback - our DC is dead");
register_fsa_input(C_CRMD_STATUS_CALLBACK, I_ELECTION, NULL);
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/crmd/ccm.c,v
retrieving revision 1.103
retrieving revision 1.104
diff -u -3 -r1.103 -r1.104
--- ccm.c 18 Apr 2006 10:59:46 -0000 1.103
+++ ccm.c 20 Apr 2006 15:43:23 -0000 1.104
@@ -1,4 +1,4 @@
-/* $Id: ccm.c,v 1.103 2006/04/18 10:59:46 andrew Exp $ */
+/* $Id: ccm.c,v 1.104 2006/04/20 15:43:23 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -184,40 +184,50 @@
*/
register_fsa_error(cause, I_ERROR, msg_data->data);
return I_NULL;
+ }
+
+ return return_input;
+}
+
+static void
+check_dead_member(const char *uname, GHashTable *members)
+{
+ CRM_CHECK(uname != NULL, return);
+ if(members != NULL && g_hash_table_lookup(members, uname) != NULL) {
+ crm_err("%s didnt really leave the membership!", uname);
+ return;
+ }
+
+ if(confirmed_nodes != NULL) {
+ g_hash_table_remove(confirmed_nodes, uname);
+ }
+ if(finalized_nodes != NULL) {
+ g_hash_table_remove(finalized_nodes, uname);
+ }
+ if(integrated_nodes != NULL) {
+ g_hash_table_remove(integrated_nodes, uname);
+ }
+
+ if(safe_str_eq(fsa_our_uname, uname)) {
+ crm_err("We're not part of the cluster anymore");
}
- if(AM_I_DC == FALSE && oc->m_n_out != 0) {
- /* Possibly move this logic to ghash_update_cib_node() */
- unsigned lpc = 0;
- int offset = oc->m_out_idx;
- for(lpc=0; lpc < oc->m_n_out; lpc++) {
- const char *uname = oc->m_array[offset+lpc].node_uname;
- if(uname == NULL) {
- crm_err("CCM node had no name");
- continue;
-
- } else {
- /* remove any no-votes they had cast */
- if(voted != NULL) {
- g_hash_table_remove(voted, uname);
- }
- if(safe_str_eq(uname, fsa_our_dc)) {
- crm_warn("Our DC node (%s) left the
cluster",
- uname);
- register_fsa_input(cause, I_ELECTION,
NULL);
- }
- }
+ if(AM_I_DC) {
+ /* remove any no-votes they had cast */
+ if(voted != NULL) {
+ g_hash_table_remove(voted, uname);
}
+
+ } else if(safe_str_eq(uname, fsa_our_dc)) {
+ crm_warn("Our DC node (%s) left the cluster", uname);
+ register_fsa_input(C_FSA_INTERNAL, I_ELECTION, NULL);
}
-
- return return_input;
}
/* A_CCM_UPDATE_CACHE */
/*
* Take the opportunity to update the node status in the CIB as well
*/
-
enum crmd_fsa_input
do_ccm_update_cache(long long action,
enum crmd_fsa_cause cause,
@@ -409,8 +419,7 @@
continue;
}
- member->node_id =
- oc->m_array[offset+lpc].node_id;
+ member->node_id = oc->m_array[offset+lpc].node_id;
member->node_born_on =
oc->m_array[offset+lpc].node_born_on;
@@ -425,22 +434,10 @@
member->node_uname =
crm_strdup(oc->m_array[offset+lpc].node_uname);
- g_hash_table_insert(
- members, member->node_uname, member);
-
g_hash_table_insert(members, member->node_uname,
member);
- if(confirmed_nodes != NULL) {
- g_hash_table_remove(
- confirmed_nodes, member->node_uname);
- }
- if(finalized_nodes != NULL) {
- g_hash_table_remove(
- finalized_nodes, member->node_uname);
- }
- if(integrated_nodes != NULL) {
- g_hash_table_remove(
- integrated_nodes, member->node_uname);
- }
+ check_dead_member(
+ member->node_uname, membership_copy->members);
+
}
} else {
membership_copy->dead_members = NULL;
@@ -530,11 +527,6 @@
oc->m_array[oc->m_out_idx+lpc].node_uname,
oc->m_array[oc->m_out_idx+lpc].node_id,
oc->m_array[oc->m_out_idx+lpc].node_born_on);
- if(fsa_our_uname != NULL
- && 0 == strcmp(fsa_our_uname,
- oc->m_array[oc->m_out_idx+lpc].node_uname)) {
- crm_err("We're not part of the cluster anymore");
- }
}
crm_debug_2("-----------------------");
@@ -627,7 +619,6 @@
update_data.caller = caller;
update_data.updates = fragment;
- update_data.state = XML_BOOLEAN_YES;
update_data.overwrite_join = overwrite;
if(overwrite == FALSE) {
@@ -635,12 +626,6 @@
crm_debug_2("Inhibiting bcast for membership updates");
}
- /* live nodes */
- if(fsa_membership_copy->members != NULL) {
- g_hash_table_foreach(fsa_membership_copy->members,
- ghash_update_cib_node, &update_data);
- }
-
/* dead nodes */
update_data.state = XML_BOOLEAN_NO;
if(fsa_membership_copy->dead_members != NULL) {
@@ -648,6 +633,13 @@
ghash_update_cib_node, &update_data);
}
+ /* live nodes */
+ update_data.state = XML_BOOLEAN_YES;
+ if(fsa_membership_copy->members != NULL) {
+ g_hash_table_foreach(fsa_membership_copy->members,
+ ghash_update_cib_node, &update_data);
+ }
+
fsa_cib_update(XML_CIB_TAG_STATUS, fragment, call_options, call_id);
add_cib_op_callback(call_id, FALSE, NULL, ccm_node_update_complete);
------------------------------
_______________________________________________
Linux-ha-cvs mailing list
[email protected]
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs
End of Linux-ha-cvs Digest, Vol 29, Issue 108
*********************************************