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: crm by andrew from
([email protected])
----------------------------------------------------------------------
Message: 1
Date: Mon, 20 Feb 2006 04:39: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:
main.c
Log Message:
Clearly indicate that the Heartbeat connection disconnected because we asked
it to.
Log the upper level of FSA timing data as errors
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/cib/main.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -3 -r1.38 -r1.39
--- main.c 19 Feb 2006 20:00:36 -0000 1.38
+++ main.c 20 Feb 2006 11:39:46 -0000 1.39
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.38 2006/02/19 20:00:36 andrew Exp $ */
+/* $Id: main.c,v 1.39 2006/02/20 11:39:46 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -403,7 +403,7 @@
cib_ha_connection_destroy(gpointer user_data)
{
if(cib_shutdown_flag) {
- crm_info("Heartbeat disconnected... exiting");
+ crm_info("Heartbeat disconnection complete... exiting");
} else {
crm_err("Heartbeat connection lost! Exiting.");
}
------------------------------
Message: 2
Date: Mon, 20 Feb 2006 04:39: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/crmd
Modified Files:
callbacks.c
Log Message:
Clearly indicate that the Heartbeat connection disconnected because we asked
it to.
Log the upper level of FSA timing data as errors
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/crmd/callbacks.c,v
retrieving revision 1.107
retrieving revision 1.108
diff -u -3 -r1.107 -r1.108
--- callbacks.c 19 Feb 2006 20:02:19 -0000 1.107
+++ callbacks.c 20 Feb 2006 11:39:46 -0000 1.108
@@ -87,11 +87,11 @@
crm_debug_3("Invoked");
if(is_set(fsa_input_register, R_HA_DISCONNECTED)) {
/* we signed out, so this is expected */
- crm_info("Connection to heartbeat service disconnected.");
+ crm_info("Heartbeat disconnection complete");
return;
}
- crm_crit("Lost connection to heartbeat service.");
+ crm_crit("Lost connection to heartbeat service!");
register_fsa_input(C_HA_DISCONNECT, I_ERROR, NULL);
trigger_fsa(fsa_source);
}
@@ -628,7 +628,7 @@
fsa_diff = sub_longclock(fsa_stop, fsa_start);
fsa_diff_ms = longclockto_ms(fsa_diff);
if(fsa_diff_ms > fsa_diff_max_ms) {
- crm_warn("FSA took %dms to complete", fsa_diff_ms);
+ crm_err("FSA took %dms to complete", fsa_diff_ms);
} else if(fsa_diff_ms > fsa_diff_warn_ms) {
crm_warn("FSA took %dms to complete", fsa_diff_ms);
------------------------------
Message: 3
Date: Mon, 20 Feb 2006 05:10: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/crmd
Modified Files:
control.c crmd_fsa.h election.c fsa.c fsa_defines.h
fsa_matrix.h utils.c
Log Message:
Remove a bunch of unused timers
Do the inital CIB query asyncronously
Ask heartbeat for the list of nodes and update the CIB based on the result
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/crmd/control.c,v
retrieving revision 1.113
retrieving revision 1.114
diff -u -3 -r1.113 -r1.114
--- control.c 14 Feb 2006 11:55:07 -0000 1.113
+++ control.c 20 Feb 2006 12:10:41 -0000 1.114
@@ -20,6 +20,7 @@
#include <sys/param.h>
+#include <heartbeat.h>
#include <crm/crm.h>
#include <crm/cib.h>
#include <crm/msg_xml.h>
@@ -161,12 +162,6 @@
} else {
register_fsa_error(C_FSA_INTERNAL, I_ERROR, NULL);
}
-
-#if 0
- /* this shouldnt be required */
- } else {
- crm_timer_start(shutdown_timer);
-#endif
}
return I_NULL;
@@ -242,14 +237,12 @@
}
/* set up the timers */
- crm_malloc0(dc_heartbeat, sizeof(fsa_timer_t));
crm_malloc0(integration_timer, sizeof(fsa_timer_t));
crm_malloc0(finalization_timer, sizeof(fsa_timer_t));
crm_malloc0(election_trigger, sizeof(fsa_timer_t));
crm_malloc0(election_timeout, sizeof(fsa_timer_t));
crm_malloc0(shutdown_escalation_timer, sizeof(fsa_timer_t));
crm_malloc0(wait_timer, sizeof(fsa_timer_t));
- crm_malloc0(shutdown_timer, sizeof(fsa_timer_t));
crm_malloc0(recheck_timer, sizeof(fsa_timer_t));
interval = interval * 1000;
@@ -264,16 +257,6 @@
was_error = TRUE;
}
- if(dc_heartbeat != NULL) {
- dc_heartbeat->source_id = 0;
- dc_heartbeat->period_ms = -1;
- dc_heartbeat->fsa_input = I_NULL;
- dc_heartbeat->callback = do_dc_heartbeat;
- dc_heartbeat->repeat = FALSE;
- } else {
- was_error = TRUE;
- }
-
if(election_timeout != NULL) {
election_timeout->source_id = 0;
election_timeout->period_ms = -1;
@@ -338,16 +321,6 @@
was_error = TRUE;
}
- if(shutdown_timer != NULL) {
- shutdown_timer->source_id = 0;
- shutdown_timer->period_ms = -1;
- shutdown_timer->fsa_input = I_SHUTDOWN;
- shutdown_timer->callback = crm_timer_popped;
- shutdown_timer->repeat = TRUE;
- } else {
- was_error = TRUE;
- }
-
if(recheck_timer != NULL) {
recheck_timer->source_id = 0;
recheck_timer->period_ms = -1;
@@ -485,6 +458,13 @@
crmd_fsa_stall(NULL);
return I_NULL;
+ } else if(is_set(fsa_input_register, R_READ_CONFIG) == FALSE) {
+ crm_info("Delaying start, Config not read (%.16llx)",
+ R_READ_CONFIG);
+
+ crmd_fsa_stall(NULL);
+ return I_NULL;
+
} else if(is_set(fsa_input_register, R_PEER_DATA) == FALSE) {
HA_Message * msg = NULL;
@@ -528,20 +508,25 @@
return I_NULL;
}
-/* A_READCONFIG */
-enum crmd_fsa_input
-do_read_config(long long action,
- enum crmd_fsa_cause cause,
- enum crmd_fsa_state cur_state,
- enum crmd_fsa_input current_input,
- fsa_data_t *msg_data)
-{
- /* this one probably is worthwhile blocking on */
- crm_data_t *cib_copy = get_cib_copy(fsa_cib_conn);
- crm_data_t *config = get_object_root(XML_CIB_TAG_CRMCONFIG, cib_copy);
- dc_heartbeat->period_ms = 0;
-
+static void
+config_query_callback(const HA_Message *msg, int call_id, int rc,
+ crm_data_t *output, void *user_data)
+{
+ crm_debug("Call %d : Parsing CIB options", call_id);
+ if(rc != cib_ok) {
+ fsa_data_t *msg_data = NULL;
+ crm_err("Local CIB query resulted in an error: %s",
+ cib_error2string(rc));
+ register_fsa_error(C_FSA_INTERNAL, I_ERROR, NULL);
+ return;
+ }
+
+#if 0
+ /* disable until we can do it properly
+ * - most people use the defaults anyway
+ */
+ crm_data_t *config = output;
xml_child_iter_filter(
config, iter, XML_CIB_TAG_NVPAIR,
@@ -551,9 +536,6 @@
if(name == NULL || value == NULL) {
continue;
- } else if(safe_str_eq(name, XML_CONFIG_ATTR_DC_BEAT)) {
- dc_heartbeat->period_ms = crm_get_msec(value);
-
} else if(safe_str_eq(name, XML_CONFIG_ATTR_DC_DEADTIME)) {
election_trigger->period_ms = crm_get_msec(value);
@@ -564,35 +546,32 @@
recheck_timer->period_ms = crm_get_msec(value);
}
);
-
- if(dc_heartbeat->period_ms < 1) {
- /* sensible default */
- dc_heartbeat->period_ms = crm_get_msec(
- getenv("HA_"KEY_KEEPALIVE));
- }
-
- election_timeout->period_ms = crm_get_msec("1min");
- /*dc_heartbeat->period_ms * 6;*/
- integration_timer->period_ms = dc_heartbeat->period_ms * 6;
- finalization_timer->period_ms = dc_heartbeat->period_ms * 6;
+#endif
+
+ set_bit_inplace(fsa_input_register, R_READ_CONFIG);
+}
+
+/* A_READCONFIG */
+enum crmd_fsa_input
+do_read_config(long long action,
+ enum crmd_fsa_cause cause,
+ enum crmd_fsa_state cur_state,
+ enum crmd_fsa_input current_input,
+ fsa_data_t *msg_data)
+{
+ int call_id = fsa_cib_conn->cmds->query(
+ fsa_cib_conn, XML_CIB_TAG_CRMCONFIG, NULL, cib_scope_local);
+
+ add_cib_op_callback(call_id, FALSE, NULL, config_query_callback);
+ crm_debug_2("Querying the CIB... call %d", call_id);
+
+ /* defaults */
+ election_trigger->period_ms = crm_get_msec("1min");
+ election_timeout->period_ms = crm_get_msec("2min");
integration_timer->period_ms = crm_get_msec("5min");
- finalization_timer->period_ms = crm_get_msec("5min");
-
- if(election_trigger->period_ms < 1
- || election_trigger->period_ms > dc_heartbeat->period_ms * 12) {
- /* sensible default */
- election_trigger->period_ms = dc_heartbeat->period_ms * 12;
- }
-
- if(shutdown_escalation_timer->period_ms < 1
- || election_timeout->period_ms >
shutdown_escalation_timer->period_ms) {
- /* sensible default - 32 election cycles */
- shutdown_escalation_timer->period_ms
- = (election_timeout->period_ms +
election_trigger->period_ms) * 32;
- }
- shutdown_timer->period_ms = election_trigger->period_ms;
+ finalization_timer->period_ms = crm_get_msec("10min");
+ shutdown_escalation_timer->period_ms = crm_get_msec("15min");
-
return I_NULL;
}
@@ -622,10 +601,26 @@
return TRUE;
}
+static void
+default_cib_update_callback(const HA_Message *msg, int call_id, int rc,
+ crm_data_t *output, void *user_data)
+{
+ if(rc != cib_ok) {
+ fsa_data_t *msg_data = NULL;
+ crm_err("CIB Update failed: %s", cib_error2string(rc));
+ crm_log_xml_warn(output, "update:failed");
+
+ register_fsa_error(C_FSA_INTERNAL, I_ERROR, NULL);
+ }
+}
gboolean
register_with_ha(ll_cluster_t *hb_cluster, const char *client_name)
{
+ int call_id = 0;
+ const char *ha_node = NULL;
+ crm_data_t *cib_node_list = NULL;
+
crm_debug("Signing in with Heartbeat");
if (hb_cluster->llc_ops->signon(hb_cluster, client_name)!= HA_OK) {
@@ -681,7 +676,7 @@
crm_debug_3("Finding our node uuid");
fsa_our_uuid = get_uuid(fsa_cluster_conn, fsa_our_uname);
- if(safe_str_eq(fsa_our_uname, fsa_our_uuid)) {
+ if(fsa_our_uuid == NULL) {
crm_err("get_uuid_by_name() failed");
return FALSE;
}
@@ -692,6 +687,52 @@
fsa_cluster_conn->llc_ops->client_status(
fsa_cluster_conn, NULL, CRM_SYSTEM_CRMD, -1);
+ crm_info("Requesting the list of configured nodes");
+ fsa_cluster_conn->llc_ops->init_nodewalk(fsa_cluster_conn);
+
+ cib_node_list = create_xml_node(NULL, XML_CIB_TAG_NODES);
+ do {
+ const char *ha_node_type = NULL;
+ const char *ha_node_uuid = NULL;
+ crm_data_t *cib_new_node = NULL;
+
+ ha_node = fsa_cluster_conn->llc_ops->nextnode(fsa_cluster_conn);
+ if(ha_node == NULL) {
+ continue;
+ }
+
+ ha_node_type = fsa_cluster_conn->llc_ops->node_type(
+ fsa_cluster_conn, ha_node);
+ if(safe_str_neq(NORMALNODE, ha_node_type)) {
+ crm_debug("Node %s: skipping '%s'",
+ ha_node, ha_node_type);
+ continue;
+ }
+
+ ha_node_uuid = get_uuid(fsa_cluster_conn, ha_node);
+ if(ha_node_uuid == NULL) {
+ continue;
+ }
+
+ crm_notice("Node: %s (uuid: %s)", ha_node, ha_node_uuid);
+ cib_new_node = create_xml_node(cib_node_list, XML_CIB_TAG_NODE);
+ crm_xml_add(cib_new_node, XML_ATTR_ID, ha_node_uuid);
+ crm_xml_add(cib_new_node, XML_ATTR_UNAME, ha_node);
+ crm_xml_add(cib_new_node, XML_ATTR_TYPE, ha_node_type);
+
+ } while(ha_node != NULL);
+
+ fsa_cluster_conn->llc_ops->end_nodewalk(fsa_cluster_conn);
+
+ /* Now update the CIB with the list of nodes */
+ call_id = fsa_cib_conn->cmds->update(
+ fsa_cib_conn, XML_CIB_TAG_NODES,
+ cib_node_list, NULL, cib_scope_local|cib_quorum_override);
+
+ add_cib_op_callback(call_id, FALSE, NULL, default_cib_update_callback);
+
+ crm_log_xml_err(cib_node_list, "NodeList");
+ free_xml(cib_node_list);
return TRUE;
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/crmd/crmd_fsa.h,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -3 -r1.49 -r1.50
--- crmd_fsa.h 19 Feb 2006 09:03:16 -0000 1.49
+++ crmd_fsa.h 20 Feb 2006 12:10:41 -0000 1.50
@@ -1,4 +1,4 @@
-/* $Id: crmd_fsa.h,v 1.49 2006/02/19 09:03:16 andrew Exp $ */
+/* $Id: crmd_fsa.h,v 1.50 2006/02/20 12:10:41 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -124,8 +124,6 @@
extern fsa_timer_t *election_trigger; /* */
extern fsa_timer_t *election_timeout; /* */
extern fsa_timer_t *shutdown_escalation_timer; /* */
-extern fsa_timer_t *shutdown_timer; /* */
-extern fsa_timer_t *dc_heartbeat;
extern fsa_timer_t *integration_timer;
extern fsa_timer_t *finalization_timer;
extern fsa_timer_t *wait_timer;
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/crmd/election.c,v
retrieving revision 1.105
retrieving revision 1.106
diff -u -3 -r1.105 -r1.106
--- election.c 19 Feb 2006 09:03:57 -0000 1.105
+++ election.c 20 Feb 2006 12:10:41 -0000 1.106
@@ -389,15 +389,6 @@
set_bit_inplace(fsa_input_register, R_JOIN_OK);
set_bit_inplace(fsa_input_register, R_INVOKE_PE);
- if(dc_heartbeat->source_id != 0) {
- crm_debug_3("Starting DC Heartbeat timer");
- dc_heartbeat->source_id = Gmain_timeout_add_full(
- G_PRIORITY_HIGH, dc_heartbeat->period_ms,
- dc_heartbeat->callback, dc_heartbeat, NULL);
- } else {
- crm_debug_3("DC Heartbeat timer already active");
- }
-
fsa_cib_conn->cmds->set_slave_all(fsa_cib_conn, cib_none);
fsa_cib_conn->cmds->set_master(fsa_cib_conn, cib_none);
@@ -425,7 +416,6 @@
{
enum crmd_fsa_input result = I_NULL;
- crm_timer_stop(dc_heartbeat);
if(action & A_DC_RELEASE) {
crm_debug("Releasing the role of DC");
clear_bit_inplace(fsa_input_register, R_THE_DC);
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/crmd/fsa.c,v
retrieving revision 1.138
retrieving revision 1.139
diff -u -3 -r1.138 -r1.139
--- fsa.c 15 Feb 2006 13:18:12 -0000 1.138
+++ fsa.c 20 Feb 2006 12:10:41 -0000 1.139
@@ -54,9 +54,7 @@
const char *fsa_our_uname = NULL;
fsa_timer_t *wait_timer = NULL;
-fsa_timer_t *dc_heartbeat = NULL;
fsa_timer_t *recheck_timer = NULL;
-fsa_timer_t *shutdown_timer = NULL;
fsa_timer_t *election_trigger = NULL;
fsa_timer_t *election_timeout = NULL;
fsa_timer_t *integration_timer = NULL;
@@ -166,9 +164,6 @@
} else if(an_action & A_CIB_START) {
do_time_check = FALSE;
-
- } else if(an_action & A_READCONFIG) {
- do_time_check = FALSE;
}
fsa_actions = clear_bit(fsa_actions, an_action);
@@ -735,7 +730,6 @@
case S_STOPPING:
case S_TERMINATE:
/* possibly redundant */
- crm_timer_stop(shutdown_timer);
set_bit_inplace(fsa_input_register, R_SHUTDOWN);
break;
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/crmd/fsa_defines.h,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -3 -r1.44 -r1.45
--- fsa_defines.h 14 Feb 2006 11:55:07 -0000 1.44
+++ fsa_defines.h 20 Feb 2006 12:10:41 -0000 1.45
@@ -1,4 +1,4 @@
-/* $Id: fsa_defines.h,v 1.44 2006/02/14 11:55:07 andrew Exp $ */
+/* $Id: fsa_defines.h,v 1.45 2006/02/20 12:10:41 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -418,8 +418,7 @@
#define R_STAYDOWN 0x00000008ULL /* Should we restart? */
#define R_JOIN_OK 0x00000010ULL /* Have we completed the join process */
-#define R_HAVE_RES 0x00000040ULL /* Do we have any resources
running
- locally */
+#define R_READ_CONFIG 0x00000040ULL
#define R_INVOKE_PE 0x00000080ULL /* Does the PE needed to be
invoked at
the next appropriate point? */
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/crmd/fsa_matrix.h,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -3 -r1.68 -r1.69
--- fsa_matrix.h 18 Feb 2006 12:39:54 -0000 1.68
+++ fsa_matrix.h 20 Feb 2006 12:10:41 -0000 1.69
@@ -769,7 +769,7 @@
/* S_RELEASE_DC ==> */ A_NOTHING,
/* S_STARTING ==> */ A_ERROR,
/* S_PENDING ==> */ A_ERROR,
- /* S_STOPPING ==> */ A_ERROR,
+ /* S_STOPPING ==> */ A_WARN,
/* S_TERMINATE ==> */ A_ERROR,
/* S_TRANSITION_ENGINE ==> */ A_PE_INVOKE,
/* S_HALT ==> */ A_ERROR,
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/crmd/utils.c,v
retrieving revision 1.85
retrieving revision 1.86
diff -u -3 -r1.85 -r1.86
--- utils.c 14 Feb 2006 11:55:07 -0000 1.85
+++ utils.c 20 Feb 2006 12:10:41 -0000 1.86
@@ -100,23 +100,17 @@
} else if(timer == shutdown_escalation_timer) {
return "Shutdown Escalation";
- } else if(timer == shutdown_timer) {
- return "Shutdown Timer";
-
} else if(timer == integration_timer) {
return "Integration Timer";
} else if(timer == finalization_timer) {
return "Finalization Timer";
- } else if(timer == dc_heartbeat) {
- return "Heartbeat Timer";
-
} else if(timer == wait_timer) {
return "Wait Timer";
} else if(timer == recheck_timer) {
- return "Recheck Timer";
+ return "PEngine Recheck Timer";
}
return "Unknown Timer";
@@ -127,20 +121,17 @@
{
fsa_timer_t *timer = (fsa_timer_t *)data;
- if(timer == shutdown_escalation_timer) {
- crm_err("%s (%s) just popped!",
+ if(timer == wait_timer
+ || timer == recheck_timer
+ || timer == election_trigger) {
+ crm_info("%s (%s) just popped!",
get_timer_desc(timer),
fsa_input2string(timer->fsa_input));
- } else if(timer == election_timeout) {
+ } else {
crm_err("%s (%s) just popped!",
get_timer_desc(timer),
fsa_input2string(timer->fsa_input));
-
- } else {
- crm_info("%s (%s) just popped!",
- get_timer_desc(timer),
- fsa_input2string(timer->fsa_input));
}
if(timer->repeat == FALSE) {
@@ -759,9 +750,9 @@
do_crm_log(log_level, __FILE__, __FUNCTION__,
"%s %.16llx (R_JOIN_OK)", text, R_JOIN_OK);
}
- if(is_set(input_register, R_HAVE_RES)) {
+ if(is_set(input_register, R_READ_CONFIG)) {
do_crm_log(log_level, __FILE__, __FUNCTION__,
- "%s %.16llx (R_HAVE_RES)", text, R_HAVE_RES);
+ "%s %.16llx (R_READ_CONFIG)", text, R_READ_CONFIG);
}
if(is_set(input_register, R_INVOKE_PE)) {
do_crm_log(log_level, __FILE__, __FUNCTION__,
------------------------------
_______________________________________________
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 83
********************************************