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: heartbeat by gshi from
([EMAIL PROTECTED])
2. Linux-HA CVS: heartbeat by gshi from
([EMAIL PROTECTED])
3. Linux-HA CVS: lib by panjiam from
([EMAIL PROTECTED])
----------------------------------------------------------------------
Message: 1
Date: Wed, 9 Nov 2005 18:16:42 -0700 (MST)
From: [EMAIL PROTECTED]
Subject: [Linux-ha-cvs] Linux-HA CVS: heartbeat by gshi from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : gshi
Host :
Project : linux-ha
Module : heartbeat
Dir : linux-ha/heartbeat
Modified Files:
Makefile.am heartbeat.c
Added Files:
hb_rexmit.c
Log Message:
bug 693: Spread out load for packet retransmission requests
Each time a missing packet is detected, a timeout event is scheduled
with a random delay between 0~MAX_REXMIT_DELAY(250ms). If the missing message
is received before the timeout event happens, the timeout event is cancelled.
Otherwise, in the timeout event function call, a rexmit request is sent to
the source node and a new timeout event is scheduled (with delay
MAX_REXMIT_DELAY).
The current timeout will be removed from mainloop by returning FALSE.
The previous periodic check for missing packets is disabled.
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/heartbeat/Makefile.am,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -3 -r1.79 -r1.80
--- Makefile.am 15 Aug 2005 04:52:42 -0000 1.79
+++ Makefile.am 10 Nov 2005 01:16:42 -0000 1.80
@@ -61,7 +61,7 @@
heartbeat_SOURCES = heartbeat.c auth.c \
config.c \
ha_msg_internal.c hb_api.c hb_resource.c \
- hb_signal.c module.c hb_uuid.c
+ hb_signal.c module.c hb_uuid.c hb_rexmit.c
heartbeat_LDADD = $(top_builddir)/lib/stonith/libstonith.la
\
$(top_builddir)/lib/pils/libpils.la \
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/heartbeat/heartbeat.c,v
retrieving revision 1.469
retrieving revision 1.470
diff -u -3 -r1.469 -r1.470
--- heartbeat.c 7 Nov 2005 22:52:57 -0000 1.469
+++ heartbeat.c 10 Nov 2005 01:16:42 -0000 1.470
@@ -2,7 +2,7 @@
* TODO:
* 1) Man page update
*/
-/* $Id: heartbeat.c,v 1.469 2005/11/07 22:52:57 gshi Exp $ */
+/* $Id: heartbeat.c,v 1.470 2005/11/10 01:16:42 gshi Exp $ */
/*
* heartbeat: Linux-HA heartbeat code
*
@@ -280,7 +280,6 @@
#define FALSE_ALARM_SIG 0x0080UL
#define MAX_MISSING_PKTS 20
-
#define ALWAYSRESTART_ON_SPLITBRAIN 1
@@ -373,8 +372,6 @@
static void check_comm_isup(void);
static int send_local_status(void);
static int set_local_status(const char * status);
-static void request_msg_rexmit(struct node_info *, seqno_t lowseq
-, seqno_t hiseq);
static void check_rexmit_reqs(void);
static void mark_node_dead(struct node_info* hip);
static void change_link_status(struct node_info* hip, struct link *lnk
@@ -1660,7 +1657,7 @@
}
/* Check to see we need to resend any rexmit requests... */
- check_rexmit_reqs();
+ (void)check_rexmit_reqs;
/* See if our comm channels are working yet... */
if (heartbeat_comm_state != COMM_LINKSUP) {
@@ -5322,6 +5319,9 @@
for (j=0; j < t->nmissing; ++j) {
/* Is this one of our missing packets? */
if (seq == t->seqmissing[j]) {
+
+ remove_msg_rexmit(thisnode, seq);
+
/* Yes. Delete it from the list */
t->seqmissing[j] = NOSEQUENCE;
/* Did we delete the last one on the list */
@@ -5384,61 +5384,13 @@
send_ack_if_needed(thisnode, ack_seq);
}
- }else if (t->first_missing_seq != 0){
-#if 0
- if (ANYDEBUG){
- cl_log(LOG_INFO, "calling request_msg_rexmit()"
- "from %s", __FUNCTION__);
- }
- request_msg_rexmit(thisnode, t->first_missing_seq,
t->first_missing_seq);
-#endif
-
}
+
return ret;
}
-static void
-request_msg_rexmit(struct node_info *node, seqno_t lowseq
-, seqno_t hiseq)
-{
- struct ha_msg* hmsg;
- char low[16];
- char high[16];
-
- if(ANYDEBUG){
- cl_log(LOG_INFO, "requesting for retransmission from node %s"
- "[%ld-%ld]",
- node->nodename,lowseq, hiseq);
- }
-
- if ((hmsg = ha_msg_new(6)) == NULL) {
- cl_log(LOG_ERR, "no memory for " T_REXMIT);
- return;
- }
-
- snprintf(low, sizeof(low), "%lu", lowseq);
- snprintf(high, sizeof(high), "%lu", hiseq);
-
-
- if ( ha_msg_add(hmsg, F_TYPE, T_REXMIT) == HA_OK
- && ha_msg_add(hmsg, F_TO, node->nodename)==HA_OK
- && ha_msg_add(hmsg, F_FIRSTSEQ, low) == HA_OK
- && ha_msg_add(hmsg, F_LASTSEQ, high) == HA_OK) {
- /* Send a re-transmit request */
- if (send_cluster_msg(hmsg) != HA_OK) {
- cl_log(LOG_ERR, "cannot send " T_REXMIT
- " request to %s", node->nodename);
- }
- node->track.last_rexmit_req = time_longclock();
-
- }else{
- ha_msg_del(hmsg);
- cl_log(LOG_ERR, "Cannot create " T_REXMIT " message.");
- }
-}
-
#define REXMIT_MS 1000
#define ACCEPT_REXMIT_REQ_MS (REXMIT_MS-10)
@@ -6064,6 +6016,18 @@
/*
* $Log: heartbeat.c,v $
+ * Revision 1.470 2005/11/10 01:16:42 gshi
+ * bug 693: Spread out load for packet retransmission requests
+ *
+ * Each time a missing packet is detected, a timeout event is scheduled
+ * with a random delay between 0~MAX_REXMIT_DELAY(250ms). If the missing
message
+ * is received before the timeout event happens, the timeout event is
cancelled.
+ * Otherwise, in the timeout event function call, a rexmit request is sent to
+ * the source node and a new timeout event is scheduled (with delay
MAX_REXMIT_DELAY).
+ * The current timeout will be removed from mainloop by returning FALSE.
+ *
+ * The previous periodic check for missing packets is disabled.
+ *
* Revision 1.469 2005/11/07 22:52:57 gshi
* fixed a few bugs related to deletion:
*
------------------------------
Message: 2
Date: Wed, 9 Nov 2005 18:34:40 -0700 (MST)
From: [EMAIL PROTECTED]
Subject: [Linux-ha-cvs] Linux-HA CVS: heartbeat by gshi from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : gshi
Host :
Project : linux-ha
Module : heartbeat
Dir : linux-ha/heartbeat
Modified Files:
hb_rexmit.c
Log Message:
fix IA64 compiling errors
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/heartbeat/hb_rexmit.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- hb_rexmit.c 10 Nov 2005 01:16:42 -0000 1.1
+++ hb_rexmit.c 10 Nov 2005 01:34:40 -0000 1.2
@@ -89,9 +89,9 @@
entry_display(gpointer key, gpointer value, gpointer user_data)
{
struct rexmit_info* ri = (struct rexmit_info*)key;
- guint tag = (guint) value;
+ unsigned long tag = (unsigned long) value;
- cl_log(LOG_INFO, "seq, node, nodename (%ld, %p, %s), tag = %d",
+ cl_log(LOG_INFO, "seq, node, nodename (%ld, %p, %s), tag = %ld",
ri->seq, ri->node, ri->node->nodename, tag);
}
@@ -188,7 +188,7 @@
static void
schedule_rexmit_request(struct node_info* node, seqno_t seq, int delay)
{
- guint sourceid;
+ unsigned long sourceid;
struct rexmit_info* ri;
if (delay == 0){
srand((int)time_longclock());
@@ -240,7 +240,7 @@
{
struct rexmit_info ri;
gpointer value;
- guint sourceid;
+ unsigned long sourceid;
ri.seq = seq;
ri.node =node;
@@ -252,7 +252,7 @@
__FUNCTION__, seq);
return HA_FAIL;
}else {
- sourceid = (guint) value;
+ sourceid = (unsigned long) value;
Gmain_timeout_remove(sourceid);
g_hash_table_remove(rexmit_hash_table, &ri);
}
------------------------------
Message: 3
Date: Wed, 9 Nov 2005 21:38:20 -0700 (MST)
From: [EMAIL PROTECTED]
Subject: [Linux-ha-cvs] Linux-HA CVS: lib by panjiam from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : panjiam
Host :
Project : linux-ha
Module : lib
Dir : linux-ha/lib/plugins/HBcomm
Modified Files:
tipc.c
Log Message:
tipc.c
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/lib/plugins/HBcomm/tipc.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- tipc.c 9 Nov 2005 10:36:30 -0000 1.1
+++ tipc.c 10 Nov 2005 04:38:19 -0000 1.2
@@ -1,5 +1,5 @@
/*
- * tipc for heartbeat
+ * tipc.c - tipc communication module for heartbeat
*
* Author: Jia Ming Pan <[EMAIL PROTECTED]>
* Copyright (c) 2005 International Business Machines
@@ -66,7 +66,7 @@
static struct hb_media *
tipc_new(unsigned int name_type,
- unsigned int seq_lower, unsigned int seq_upper);
+ unsigned int seq_lower, unsigned int seq_upper);
static int tipc_parse(const char * line);
static int tipc_open(struct hb_media * mp);
@@ -129,21 +129,16 @@
{
struct tipc_private * tipc = NULL;
struct hb_media * mp = NULL;
- char * name;
mp = MALLOC(sizeof(struct hb_media));
-
if ( mp == NULL ){
PILCallLog(LOG, PIL_CRIT,
"%s: malloc failed for hb_media", __FUNCTION__);
return NULL;
}
- mp->name = name;
-
tipc = MALLOC(sizeof(struct tipc_private));
-
if ( tipc == NULL ){
PILCallLog(LOG, PIL_CRIT,
"%s: malloc failed for tipc_private", __FUNCTION__);
@@ -152,7 +147,6 @@
}
tipc->name_type = name_type;
-
tipc->seq_lower = seq_lower;
tipc->seq_upper = seq_upper;
@@ -216,7 +210,7 @@
if ( media == NULL ) {
PILCallLog(LOG, PIL_CRIT,
- "%s: alloc media failed", __FUNCTION__);
+ "%s: Could not create media", __FUNCTION__);
return HA_FAIL;
}
@@ -225,7 +219,7 @@
if ( media->name == NULL ) {
PILCallLog(LOG, PIL_CRIT,
- "%s: alloc media's name failed", __FUNCTION__);
+ "%s: Could not alloc media's name", __FUNCTION__);
FREE(media);
return HA_FAIL;
}
@@ -242,8 +236,9 @@
struct tipc_private * tipc = NULL;
tipc = (struct tipc_private *) mp->pd;
- PILCallLog(LOG, PIL_INFO, "%s: tipc_open called", __FUNCTION__);
-
+
+ TIPC_ASSERT(mp);
+
tipc->recvfd = tipc_make_receive_sock(mp);
if ( tipc->recvfd < 0 ) {
PILCallLog(LOG, PIL_CRIT, "%s: Open receive socket failed",
@@ -260,7 +255,7 @@
return HA_FAIL;
}
- PILCallLog(LOG, PIL_INFO, "%s: tipc_open OK", __FUNCTION__);
+ PILCallLog(LOG, PIL_INFO, "%s: Open tipc successfully", __FUNCTION__);
return HA_OK;
}
@@ -270,6 +265,8 @@
{
struct tipc_private * tipc;
+ TIPC_ASSERT(mp);
+
tipc = (struct tipc_private *) mp->pd;
if ( tipc->recvfd >= 0 ) {
@@ -283,6 +280,7 @@
FREE(tipc);
FREE(mp);
+ PILCallLog(LOG, PIL_INFO, "%s: tipc closed", __FUNCTION__);
return HA_OK;
}
@@ -298,16 +296,19 @@
TIPC_ASSERT(mp);
- /*
- PILCallLog(LOG, PIL_INFO, "%s: reading msg", __FUNCTION__);
- */
tipc = (struct tipc_private *) mp->pd;
sock_len = sizeof(struct sockaddr_tipc);
if (( numbytes = recvfrom(tipc->recvfd, tipc_pkt, MAXMSG, 0,
- (struct sockaddr*)&client_addr, &sock_len)) < 0) {
- PILCallLog(LOG, PIL_WARN, "%s: unable to read message",
__FUNCTION__);
+ (struct sockaddr*)&client_addr, &sock_len)) < 0) {
+
+ if ( errno != EINTR ) {
+ PILCallLog(LOG, PIL_CRIT,
+ "%s: Error receiving message: %s",
+ __FUNCTION__, strerror(errno));
+ }
+
return NULL;
}
@@ -315,7 +316,8 @@
*len = numbytes + 1;
if ( Debug >= PKTTRACE ) {
- PILCallLog(LOG, PIL_INFO, "%s: Got %d bytes", __FUNCTION__,
numbytes);
+ PILCallLog(LOG, PIL_INFO, "%s: Got %d bytes",
+ __FUNCTION__, numbytes);
}
return tipc_pkt;
@@ -339,18 +341,21 @@
if ( (numbytes = sendto(tipc->sendfd, msg, len, 0,
(struct sockaddr *)&tipc->maddr,
sock_len)) < 0 ){
- PILCallLog(LOG, PIL_INFO, "%s: unable to send message",
__FUNCTION__);
+ PILCallLog(LOG, PIL_CRIT, "%s: Unable to send message: %s",
+ __FUNCTION__, strerror(errno));
return HA_FAIL;
}
if ( numbytes != len ) {
- PILCallLog(LOG, PIL_WARN, "%s: Sent %d bytes, message length
is %d",
+ PILCallLog(LOG, PIL_WARN,
+ "%s: Sent %d bytes, message length is %d",
__FUNCTION__, numbytes, len);
return HA_FAIL;
}
if ( Debug >= PKTTRACE ) {
- PILCallLog(LOG, PIL_INFO, "%s: Sent %d bytes", __FUNCTION__,
numbytes);
+ PILCallLog(LOG, PIL_INFO, "%s: Sent %d bytes",
+ __FUNCTION__, numbytes);
}
return HA_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 24, Issue 44
********************************************