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: linux-ha by panjiam from
([email protected])
2. Linux-HA CVS: crm by andrew from
([email protected])
----------------------------------------------------------------------
Message: 1
Date: Mon, 27 Feb 2006 02:20:14 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: linux-ha by panjiam from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : panjiam
Host :
Module : linux-ha
Dir : linux-ha
Modified Files:
configure.in
Log Message:
moved the CIB data from CM_LinuxHAv2.py.in into CIB.py.in
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/configure.in,v
retrieving revision 1.488
retrieving revision 1.489
diff -u -3 -r1.488 -r1.489
--- configure.in 14 Feb 2006 11:32:12 -0000 1.488
+++ configure.in 27 Feb 2006 09:20:14 -0000 1.489
@@ -10,7 +10,7 @@
AC_INIT(heartbeat.spec.in)
AC_CONFIG_AUX_DIR(.)
-AC_REVISION($Revision: 1.488 $) dnl cvs revision
+AC_REVISION($Revision: 1.489 $) dnl cvs revision
AC_CANONICAL_HOST
@@ -2505,6 +2505,7 @@
cts/CTSproxy.py \
cts/extracttests.py \
cts/OCFIPraTest.py \
+ cts/CIB.py \
crm/Makefile \
crm/cib/Makefile \
crm/crmd/Makefile \
------------------------------
Message: 2
Date: Mon, 27 Feb 2006 02:55:58 -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/tengine
Modified Files:
actions.c callbacks.c main.c tengine.h utils.c
Log Message:
Forced actions to get lost and made sure the recovery process works.
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/tengine/actions.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -3 -r1.15 -r1.16
--- actions.c 20 Feb 2006 17:05:27 -0000 1.15
+++ actions.c 27 Feb 2006 09:55:57 -0000 1.16
@@ -1,4 +1,4 @@
-/* $Id: actions.c,v 1.15 2006/02/20 17:05:27 andrew Exp $ */
+/* $Id: actions.c,v 1.16 2006/02/27 09:55:57 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -35,8 +35,7 @@
IPC_Channel *crm_ch = NULL;
void send_rsc_command(crm_action_t *action);
-extern void cib_action_updated(const HA_Message *msg, int call_id, int rc,
- crm_data_t *output, void *user_data);
+extern crm_action_timer_t *transition_timer;
static void
te_start_action_timer(crm_action_t *action)
@@ -330,10 +329,9 @@
crm_debug("Updating CIB with %s action %d: %s %s on %s (call_id=%d)",
op_status2text(status), action->id, task_uuid, rsc_id,
target, rc);
- if(status == LRM_OP_PENDING) {
- crm_debug_2("Waiting for callback id: %d", rc);
- add_cib_op_callback(rc, FALSE, action, cib_action_updated);
- }
+ crm_debug_2("Waiting for callback id: %d", rc);
+ add_cib_op_callback(rc, FALSE, action, cib_action_updated);
+
free_xml(fragment);
free_xml(state);
@@ -381,8 +379,16 @@
cmd = create_request(CRM_OP_INVOKE_LRM, rsc_op, on_node,
CRM_SYSTEM_LRMD, CRM_SYSTEM_TENGINE, NULL);
-
+#if 1
send_ipc_message(crm_ch, cmd);
+#else
+ /* test the TE timer/recovery code */
+ if((action->id % 11) == 0) {
+ crm_err("Faking lost action %d: %s", action->id, task_uuid);
+ } else {
+ send_ipc_message(crm_ch, cmd);
+ }
+#endif
action->executed = TRUE;
value = g_hash_table_lookup(action->params, XML_ATTR_TE_NOWAIT);
@@ -413,72 +419,25 @@
te_fence_node
};
-static int
-unconfirmed_actions(gboolean send_updates)
-{
- int unconfirmed = 0;
- crm_debug_2("Unconfirmed actions...");
- slist_iter(
- synapse, synapse_t, transition_graph->synapses, lpc,
-
- /* lookup event */
- slist_iter(
- action, crm_action_t, synapse->actions, lpc2,
- if(action->executed == FALSE) {
- continue;
-
- } else if(action->confirmed) {
- continue;
- }
-
- unconfirmed++;
- crm_debug("Action %d: unconfirmed",action->id);
- if(send_updates) {
- cib_action_update(action, LRM_OP_TIMEOUT);
- }
- );
- );
- if(unconfirmed > 0) {
- crm_info("Waiting on %d unconfirmed actions", unconfirmed);
- }
- return unconfirmed;
-}
-
void
notify_crmd(crm_graph_t *graph)
{
- int log_level = LOG_DEBUG;
- const char *abort_reason = "Complete";
- enum transition_action completion_action = tg_restart;
- int id = -1;
-
- int unconfirmed = unconfirmed_actions(FALSE);
- int pending_callbacks = num_cib_op_callbacks();
HA_Message *cmd = NULL;
+ int log_level = LOG_DEBUG;
const char *op = CRM_OP_TEABORT;
+ int pending_callbacks = num_cib_op_callbacks();
+
- if(unconfirmed != 0) {
- crm_err("Write %d unconfirmed actions to the CIB", unconfirmed);
- /* TODO: actually write them */
- unconfirmed_actions(TRUE);
-
-/* return; */
- }
+ stop_te_timer(transition_timer);
if(pending_callbacks != 0) {
- crm_err("Delaying completion until all CIB updates complete");
+ crm_warn("Delaying completion until all CIB updates complete");
return;
}
CRM_DEV_ASSERT(graph->complete);
-
- completion_action = graph->completion_action;
- id = graph->id;
- if(graph->abort_reason != NULL) {
- abort_reason = graph->abort_reason;
- }
- switch(completion_action) {
+ switch(graph->completion_action) {
case tg_stop:
op = CRM_OP_TECOMPLETE;
log_level = LOG_INFO;
@@ -495,15 +454,15 @@
}
te_log_action(log_level, "Transition %d status: %s - %s",
- id, op, abort_reason);
+ graph->id, op, graph->abort_reason);
print_graph(log_level, graph);
cmd = create_request(
op, NULL, NULL, CRM_SYSTEM_DC, CRM_SYSTEM_TENGINE, NULL);
- if(abort_reason != NULL) {
- ha_msg_add(cmd, "message", abort_reason);
+ if(graph->abort_reason != NULL) {
+ ha_msg_add(cmd, "message", graph->abort_reason);
}
send_ipc_message(crm_ch, cmd);
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/tengine/callbacks.c,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -3 -r1.69 -r1.70
--- callbacks.c 20 Feb 2006 16:21:51 -0000 1.69
+++ callbacks.c 27 Feb 2006 09:55:57 -0000 1.70
@@ -1,4 +1,4 @@
-/* $Id: callbacks.c,v 1.69 2006/02/20 16:21:51 andrew Exp $ */
+/* $Id: callbacks.c,v 1.70 2006/02/27 09:55:57 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -44,6 +44,32 @@
gboolean shuttingdown = FALSE;
crm_graph_t *transition_graph;
GTRIGSource *transition_trigger = NULL;
+crm_action_timer_t *transition_timer = NULL;
+
+static gboolean
+start_global_timer(crm_action_timer_t *timer, int timeout)
+{
+ CRM_ASSERT(timer != NULL);
+ CRM_DEV_ASSERT(timer > 0);
+ CRM_DEV_ASSERT(timer->source_id == 0);
+
+ if(timeout <= 0) {
+ crm_err("Tried to start timer with period: %d", timeout);
+
+ } else if(timer->source_id == 0) {
+ crm_debug("Starting abort timer: %d", timeout);
+ timer->timeout = timeout;
+ timer->source_id = Gmain_timeout_add(
+ timeout, global_timer_callback, (void*)timer);
+ CRM_ASSERT(timer->source_id != 0);
+ return TRUE;
+
+ } else {
+ crm_err("Timer is already active with period: %d",
timer->timeout);
+ }
+
+ return FALSE;
+}
void
te_update_diff(const char *event, HA_Message *msg)
@@ -191,6 +217,8 @@
} else {
destroy_graph(transition_graph);
transition_graph = unpack_graph(xml_data);
+ start_global_timer(transition_timer,
+
transition_graph->transition_timeout);
trigger_graph();
print_graph(LOG_DEBUG, transition_graph);
}
@@ -335,6 +363,8 @@
cib_fencing_updated(const HA_Message *msg, int call_id, int rc,
crm_data_t *output, void *user_data)
{
+ trigger_graph();
+
if(rc < cib_ok) {
crm_err("CIB update failed: %s", cib_error2string(rc));
crm_log_xml_warn(msg, "[Failed Update]");
@@ -349,11 +379,12 @@
const char *task_uuid = crm_element_value(
action->xml, XML_LRM_ATTR_TASK_KEY);
+ trigger_graph();
+
CRM_DEV_ASSERT(rc == cib_ok);
if(rc < cib_ok) {
crm_err("Update for action %d (%s) FAILED: %s",
action->id, task_uuid, cib_error2string(rc));
- return;
}
}
@@ -392,6 +423,39 @@
return FALSE;
}
+
+static int
+unconfirmed_actions(gboolean send_updates)
+{
+ int unconfirmed = 0;
+ crm_debug_2("Unconfirmed actions...");
+ slist_iter(
+ synapse, synapse_t, transition_graph->synapses, lpc,
+
+ /* lookup event */
+ slist_iter(
+ action, crm_action_t, synapse->actions, lpc2,
+ if(action->executed == FALSE) {
+ continue;
+
+ } else if(action->confirmed) {
+ continue;
+ }
+
+ unconfirmed++;
+ crm_debug("Action %d: unconfirmed",action->id);
+
+ if(action->type == action_type_rsc && send_updates) {
+ cib_action_update(action, LRM_OP_PENDING);
+ }
+ );
+ );
+ if(unconfirmed > 0) {
+ crm_info("Waiting on %d unconfirmed actions", unconfirmed);
+ }
+ return unconfirmed;
+}
+
gboolean
global_timer_callback(gpointer data)
{
@@ -415,21 +479,26 @@
crm_err("Ignoring timeout while not in transition");
} else if(timer->reason == timeout_abort) {
- crm_err("Transition abort timeout reached..."
+ int unconfirmed = unconfirmed_actions(FALSE);
+ crm_warn("Transition abort timeout reached..."
" marking transition complete.");
- print_graph(LOG_WARNING, transition_graph);
transition_graph->complete = TRUE;
- abort_transition(INFINITY, -1, "Global Timeout", NULL);
+ abort_transition(INFINITY, tg_restart, "Global Timeout", NULL);
+
+ if(unconfirmed != 0) {
+ crm_warn("Writing %d unconfirmed actions to the CIB",
+ unconfirmed);
+ unconfirmed_actions(TRUE);
+ }
}
return FALSE;
}
-crm_action_timer_t *transition_timer = NULL;
-
gboolean
te_graph_trigger(gpointer user_data)
{
+ int timeout = 0;
int pending_updates = 0;
enum transition_status graph_rc = -1;
@@ -438,24 +507,18 @@
return TRUE;
}
- if(transition_timer == NULL) {
- crm_malloc0(transition_timer, sizeof(crm_action_timer_t));
- transition_timer->source_id = 0;
- transition_timer->reason = timeout_abort;
- transition_timer->action = NULL;
- }
-
graph_rc = run_graph(transition_graph);
+ timeout = transition_graph->transition_timeout;
print_graph(LOG_DEBUG_2, transition_graph);
- transition_timer->timeout = transition_graph->transition_timeout;
if(graph_rc == transition_active) {
crm_debug_3("Transition not yet complete");
stop_te_timer(transition_timer);
- start_te_timer(transition_timer);
+ start_global_timer(transition_timer, timeout);
return TRUE;
} else if(graph_rc == transition_pending) {
+ timeout = transition_timer->timeout;
crm_debug_3("Transition not yet complete - no actions fired");
return TRUE;
}
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/tengine/main.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -3 -r1.31 -r1.32
--- main.c 14 Feb 2006 11:40:25 -0000 1.31
+++ main.c 27 Feb 2006 09:55:57 -0000 1.32
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.31 2006/02/14 11:40:25 andrew Exp $ */
+/* $Id: main.c,v 1.32 2006/02/27 09:55:57 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -49,6 +49,7 @@
const char* crm_system_name = SYS_NAME;
cib_t *te_cib_conn = NULL;
extern GTRIGSource *transition_trigger;
+extern crm_action_timer_t *transition_timer;
void usage(const char* cmd, int exit_status);
int init_start(void);
@@ -190,6 +191,11 @@
transition_graph = unpack_graph(NULL);
transition_graph->complete = TRUE;
transition_graph->completion_action = tg_restart;
+
+ crm_malloc0(transition_timer, sizeof(crm_action_timer_t));
+ transition_timer->source_id = 0;
+ transition_timer->reason = timeout_abort;
+ transition_timer->action = NULL;
}
if(init_ok) {
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/tengine/tengine.h,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -3 -r1.35 -r1.36
--- tengine.h 20 Feb 2006 16:21:51 -0000 1.35
+++ tengine.h 27 Feb 2006 09:55:57 -0000 1.36
@@ -1,4 +1,4 @@
-/* $Id: tengine.h,v 1.35 2006/02/20 16:21:51 andrew Exp $ */
+/* $Id: tengine.h,v 1.36 2006/02/27 09:55:57 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -35,7 +35,6 @@
/* utils */
extern gboolean stop_te_timer(crm_action_timer_t *timer);
-extern gboolean start_te_timer(crm_action_timer_t *timer);
extern const char *get_rsc_state(const char *task, op_status_t status);
/* unpack */
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/tengine/utils.c,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -3 -r1.56 -r1.57
--- utils.c 20 Feb 2006 16:21:51 -0000 1.56
+++ utils.c 27 Feb 2006 09:55:57 -0000 1.57
@@ -1,4 +1,4 @@
-/* $Id: utils.c,v 1.56 2006/02/20 16:21:51 andrew Exp $ */
+/* $Id: utils.c,v 1.57 2006/02/27 09:55:57 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -81,29 +81,6 @@
}
gboolean
-start_te_timer(crm_action_timer_t *timer)
-{
- if(timer == NULL) {
- return FALSE;
-
- } else if(timer->source_id != 0) {
- timer->source_id = Gmain_timeout_add(
- timer->timeout, global_timer_callback, (void*)timer);
- CRM_ASSERT(timer->source_id != 0);
- return TRUE;
-
- } else if(timer->timeout < 0) {
- crm_err("Tried to start timer with -ve period");
-
- } else {
- crm_debug_3("#!!#!!# Timer already running (%d)",
- timer->source_id);
- }
- return FALSE;
-}
-
-
-gboolean
stop_te_timer(crm_action_timer_t *timer)
{
if(timer == NULL) {
------------------------------
_______________________________________________
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 100
*********************************************