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: include by andrew from
([email protected])
2. Linux-HA CVS: crm by andrew from
([email protected])
----------------------------------------------------------------------
Message: 1
Date: Tue, 21 Feb 2006 07:41:31 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: include by andrew from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : andrew
Host :
Project : linux-ha
Module : include
Dir : linux-ha/include/crm
Modified Files:
crm.h
Log Message:
Update the CRM version number
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/include/crm/crm.h,v
retrieving revision 1.86
retrieving revision 1.87
diff -u -3 -r1.86 -r1.87
--- crm.h 2 Feb 2006 08:33:14 -0000 1.86
+++ crm.h 21 Feb 2006 14:41:31 -0000 1.87
@@ -1,4 +1,4 @@
-/* $Id: crm.h,v 1.86 2006/02/02 08:33:14 andrew Exp $ */
+/* $Id: crm.h,v 1.87 2006/02/21 14:41:31 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -84,7 +84,7 @@
#define CIB_FILENAME WORKING_DIR"/cib.xml"
#define CIB_BACKUP WORKING_DIR"/cib_backup.xml"
-#define CRM_FEATURE_SET "1.0.3"
+#define CRM_FEATURE_SET "1.0.4"
#define MSG_LOG 1
#define DOT_FSA_ACTIONS 1
------------------------------
Message: 2
Date: Tue, 21 Feb 2006 10:28:49 -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:
Fix for a timing issue where a remote CCM registered the DC exited before
the last CIB update(s) from the DC were applied.
New sequence is:
1) If we have no peers, goto 5)
2) Send a "I want to exit" broadcast message
3) Wait for a single reply then goto 5)
4) If no reply is received after N seconds, log an error/warning and goto 5)
5) Disconnect from HA and exit
As long as one node has the update, the join process will make sure it ends
up on the new DC. If for some reason *none* of our peers reply, we still
exit in at most N seconds and we're no worse off than we were before.
Currently N = 5s
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/cib/callbacks.c,v
retrieving revision 1.113
retrieving revision 1.114
diff -u -3 -r1.113 -r1.114
--- callbacks.c 20 Feb 2006 13:03:54 -0000 1.113
+++ callbacks.c 21 Feb 2006 17:28:49 -0000 1.114
@@ -1,4 +1,4 @@
-/* $Id: callbacks.c,v 1.113 2006/02/20 13:03:54 andrew Exp $ */
+/* $Id: callbacks.c,v 1.114 2006/02/21 17:28:49 andrew Exp $ */
/*
* Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
*
@@ -31,6 +31,7 @@
#include <hb_api.h>
#include <clplumbing/uids.h>
#include <clplumbing/cl_uuid.h>
+#include <clplumbing/Gmain_timeout.h>
#include <crm/crm.h>
#include <crm/cib.h>
@@ -51,14 +52,19 @@
extern GMainLoop* mainloop;
extern gboolean cib_shutdown_flag;
+extern void GHFunc_count_peers(
+ gpointer key, gpointer value, gpointer user_data);
+extern enum cib_errors revision_check(
+ crm_data_t *cib_update, crm_data_t *cib_copy, int flags);
+
+void initiate_exit(void);
+void terminate_ha_connection(const char *caller);
gint cib_GCompareFunc(gconstpointer a, gconstpointer b);
gboolean cib_msg_timeout(gpointer data);
void cib_GHFunc(gpointer key, gpointer value, gpointer user_data);
gboolean can_write(int flags);
HA_Message *cib_msg_copy(HA_Message *msg, gboolean with_data);
gboolean ccm_manual_check(gpointer data);
-extern enum cib_errors revision_check(
- crm_data_t *cib_update, crm_data_t *cib_copy, int flags);
void send_cib_replace(const HA_Message *sync_request, const char *host);
void cib_process_request(
HA_Message *request, gboolean privileged, gboolean force_synchronous,
@@ -208,6 +214,7 @@
{CRM_OP_PING, FALSE, FALSE, FALSE, cib_prepare_none,
cib_cleanup_output, cib_process_ping},
{CIB_OP_ERASE, TRUE, TRUE, TRUE, cib_prepare_none,
cib_cleanup_output, cib_process_erase},
{CRM_OP_NOOP, FALSE, FALSE, FALSE, cib_prepare_none,
cib_cleanup_none, cib_process_default},
+ {"cib_shutdown_req",FALSE, TRUE, FALSE, cib_prepare_sync,
cib_cleanup_sync, cib_process_shutdown_req},
};
int send_via_callback_channel(HA_Message *msg, const char *token);
@@ -713,6 +720,15 @@
process = FALSE;
}
+ } else if(safe_str_eq(op, "cib_shutdown_req")) {
+ if(reply_to != NULL) {
+ crm_debug("Processing %s from %s", op, host);
+ needs_reply = FALSE;
+
+ } else {
+ crm_debug("Processing %s reply from %s", op, host);
+ }
+
} else if(crm_is_true(update) && safe_str_eq(reply_to, cib_our_uname)) {
crm_debug("Processing global/peer update from %s"
" that originated from us", originator);
@@ -750,7 +766,7 @@
} else if(reply_to == NULL && cib_is_master == FALSE) {
/* this is for the master instance and we're not it */
- crm_debug("Ignoring reply to %s", crm_str(reply_to));
+ crm_debug("Ignoring %s reply to %s", op, crm_str(reply_to));
return;
} else {
@@ -1286,7 +1302,6 @@
}
}
-
gboolean
cib_process_disconnect(IPC_Channel *channel, cib_client_t *cib_client)
{
@@ -1329,24 +1344,15 @@
keep_connection = FALSE;
}
- if(keep_connection == FALSE
- && cib_shutdown_flag
- && g_hash_table_size(client_list) == 0) {
+ if(cib_shutdown_flag && g_hash_table_size(client_list) == 0) {
crm_info("All clients disconnected...");
-
- if(hb_conn != NULL) {
- crm_info("Disconnecting heartbeat");
- hb_conn->llc_ops->signoff(hb_conn, FALSE);
- } else {
- crm_err("No heartbeat connection");
- exit(LSB_EXIT_OK);
- }
+ CRM_DEV_ASSERT(keep_connection == FALSE);
+ initiate_exit();
}
return keep_connection;
}
-
gboolean
cib_ha_dispatch(IPC_Channel *channel, gpointer user_data)
{
@@ -1661,22 +1667,57 @@
gboolean
can_write(int flags)
{
-
if(cib_have_quorum) {
return TRUE;
} else if((flags & cib_quorum_override) != 0) {
return TRUE;
}
-#if 0
- const char *value = NULL;
- /* this only affects admin changes which can be forced with -f */
- value = get_crm_option(the_cib, "no_quorum_policy", TRUE);
- if(safe_str_eq(value, "ignore")) {
- return TRUE;
- }
-#endif
+
return FALSE;
}
+static gboolean
+cib_force_exit(gpointer data)
+{
+ crm_err("Forcing exit!");
+ terminate_ha_connection(__FUNCTION__);
+ return FALSE;
+}
+
+void
+initiate_exit(void)
+{
+ int active = 0;
+ HA_Message *leaving = NULL;
+
+ g_hash_table_foreach(peer_hash, GHFunc_count_peers, &active);
+ if(active < 2) {
+ terminate_ha_connection(__FUNCTION__);
+ return;
+ }
+ crm_info("Sending disconnect notification to %d peers...", active);
+
+ leaving = ha_msg_new(3);
+ ha_msg_add(leaving, F_TYPE, "cib");
+ ha_msg_add(leaving, F_CIB_OPERATION, "cib_shutdown_req");
+
+ send_ha_message(hb_conn, leaving, NULL, TRUE);
+ crm_msg_del(leaving);
+
+ Gmain_timeout_add(crm_get_msec("5s"), cib_force_exit, NULL);
+}
+
+void
+terminate_ha_connection(const char *caller)
+{
+ if(hb_conn != NULL) {
+ crm_info("%s: Disconnecting heartbeat", caller);
+ hb_conn->llc_ops->signoff(hb_conn, FALSE);
+
+ } else {
+ crm_err("%s: No heartbeat connection", caller);
+ exit(LSB_EXIT_OK);
+ }
+}
------------------------------
_______________________________________________
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 90
********************************************