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: lib by alan from  ([email protected])
   2. Linux-HA CVS: heartbeat by alan from 
      ([email protected])
   3. Linux-HA CVS: include by alan from 
      ([email protected])


----------------------------------------------------------------------

Message: 1
Date: Sun,  5 Feb 2006 21:13:21 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: lib by alan from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : alan
Host    : 
Project : linux-ha
Module  : lib

Dir     : linux-ha/lib/clplumbing


Modified Files:
        GSource.c 


Log Message:
Put in instrumentation in the GSource for IPC channels which 
times how long resume_io() takes.  I set a limit for squawking of 10ms
(as a first approximation)

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/lib/clplumbing/GSource.c,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -3 -r1.67 -r1.68
--- GSource.c   4 Feb 2006 17:25:27 -0000       1.67
+++ GSource.c   6 Feb 2006 04:13:20 -0000       1.68
@@ -1,4 +1,4 @@
-/* $Id: GSource.c,v 1.67 2006/02/04 17:25:27 alan Exp $ */
+/* $Id: GSource.c,v 1.68 2006/02/06 04:13:20 alan Exp $ */
 /*
  * Copyright (c) 2002 Alan Robertson <[EMAIL PROTECTED]>
  *
@@ -625,7 +625,29 @@
                chp->ch->ops->resume_io(chp->ch);
        }
 #else
-       chp->ch->ops->resume_io(chp->ch);
+       {
+               longclock_t     resume_start;
+               if (ANYDEBUG) {
+                       resume_start = time_longclock();
+               }
+
+               chp->ch->ops->resume_io(chp->ch);
+
+               if (ANYDEBUG) {
+                       longclock_t resume_end = time_longclock();
+                       unsigned long   ms;
+                       ms = longclockto_ms(sub_longclock(resume_end
+                       ,       resume_start));
+                       if (ms > 10) {
+                               cl_log(LOG_WARNING
+                               ,       "%s: resume_io() for %s took %lu ms"
+                               ,       __FUNCTION__
+                               ,       chp->description, ms);
+                       }
+               }
+       }
+       
+       
 #endif
 
        if(chp->dispatch) {




------------------------------

Message: 2
Date: Sun,  5 Feb 2006 21:34:37 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: heartbeat by alan from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : alan
Host    : 
Project : linux-ha
Module  : heartbeat

Dir     : linux-ha/heartbeat


Modified Files:
        heartbeat.c 


Log Message:
Removed two cases where we could possibly block (but we didn't realize it)
They've been in the code since a very long time ago.
One was for reading FIFO messages (unusual) and one for reading messages
from the network - very common.
This latter case has been implicated in several of our extra long delays
in heartbeat.

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/heartbeat/heartbeat.c,v
retrieving revision 1.491
retrieving revision 1.492
diff -u -3 -r1.491 -r1.492
--- heartbeat.c 2 Feb 2006 20:58:56 -0000       1.491
+++ heartbeat.c 6 Feb 2006 04:34:36 -0000       1.492
@@ -2,7 +2,7 @@
  * TODO:
  * 1) Man page update
  */
-/* $Id: heartbeat.c,v 1.491 2006/02/02 20:58:56 alan Exp $ */
+/* $Id: heartbeat.c,v 1.492 2006/02/06 04:34:36 alan Exp $ */
 /*
  * heartbeat: Linux-HA heartbeat code
  *
@@ -250,6 +250,7 @@
 #include <clplumbing/cpulimits.h>
 #include <clplumbing/netstring.h>
 #include <clplumbing/coredumps.h>
+#include <clplumbing/cl_random.h>
 #include <heartbeat.h>
 #include <ha_msg.h>
 #include <hb_api.h>
@@ -779,6 +780,7 @@
                cl_log(LOG_DEBUG, "uuid is:%s", uuid_str);
        }
        
+       /* We only need to add our uuid if it's not already in table */
        add_uuidtable(&config->uuid, curnode);
        cl_uuid_copy(&curnode->uuid, &config->uuid);
        write_cache_file(config);
@@ -1189,11 +1191,15 @@
 static gboolean
 FIFO_child_msg_dispatch(IPC_Channel* source, gpointer user_data)
 {
-       struct ha_msg*  msg = msgfromIPC(source, 0);
+       struct ha_msg*  msg;
 
        if (DEBUGDETAILS) {
                cl_log(LOG_DEBUG, "FIFO_child_msg_dispatch() {");
        }
+       if (!source->ops->is_message_pending(source)) {
+               return TRUE;
+       }
+       msg = msgfromIPC(source, 0);
        if (msg != NULL) {
                /* send_cluster_msg disposes of "msg" */
                send_cluster_msg(msg);
@@ -1210,7 +1216,7 @@
 static gboolean
 read_child_dispatch(IPC_Channel* source, gpointer user_data)
 {
-       struct ha_msg*  msg = msgfromIPC(source, MSG_NEEDAUTH);
+       struct ha_msg*  msg;
        struct hb_media** mp = user_data;
        int     media_idx = mp - &sysmedia[0];
 
@@ -1224,6 +1230,14 @@
                cl_log(LOG_DEBUG
                ,       "read_child_dispatch() {");
        }
+       if (!source->ops->is_message_pending(source)) {
+               if (DEBUGDETAILS) {
+                       cl_log(LOG_DEBUG
+                       ,       "}/*read_child_dispatch(0)*/;");
+               }
+               return TRUE;
+       }
+       msg = msgfromIPC(source, MSG_NEEDAUTH);
        if (msg != NULL) {
                const char * from = ha_msg_value(msg, F_ORIG);
                struct link* lnk = NULL;
@@ -2384,12 +2398,8 @@
                ha_free(nodes[i]);
                nodes[i]=NULL;
        }
-       
-       
        write_cache_file(config);
-       
-       return ;
-       
+       return;
 }
 
 
@@ -2400,7 +2410,7 @@
        struct ha_msg* delmsg;
        
        cl_log(LOG_INFO,
-              "Deletinging node [%s] from configuration.",
+              "Deleting node [%s] from configuration.",
               node);
        
        thisnode = lookup_node(node);
@@ -3096,8 +3106,8 @@
                                return;
                        }
                        /*
-                        * Suppress status updates until we hear the second
-                        * heartbeat from the new node.
+                        * Suppress status updates to our clients until we
+                        * hear the second heartbeat from the new node.
                         *
                         * We've already updated the node table and we will
                         * report its status if asked...
@@ -5007,6 +5017,7 @@
        }
        
        if (from && !cl_uuid_is_null(&fromuuid)){
+               /* We didn't know their uuid before, but now we do... */
                if (update_tables(from, &fromuuid)){
                        write_cache_file(config);
                }
@@ -6073,6 +6084,14 @@
 
 /*
  * $Log: heartbeat.c,v $
+ * Revision 1.492  2006/02/06 04:34:36  alan
+ * Removed two cases where we could possibly block (but we didn't realize it)
+ * They've been in the code since a very long time ago.
+ * One was for reading FIFO messages (unusual) and one for reading messages
+ * from the network - very common.
+ * This latter case has been implicated in several of our extra long delays
+ * in heartbeat.
+ *
  * Revision 1.491  2006/02/02 20:58:56  alan
  * Changed the priorities of a few of the realtime events in heartbeat.
  *




------------------------------

Message: 3
Date: Sun,  5 Feb 2006 21:49:16 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: include by alan from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : alan
Host    : 
Project : linux-ha
Module  : include

Dir     : linux-ha/include/clplumbing


Modified Files:
        Makefile.am cl_misc.h 
Added Files:
        cl_random.h 


Log Message:
Added new random number generation capabilities to keep ahead of the need for 
new random numbers.

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/include/clplumbing/Makefile.am,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -3 -r1.29 -r1.30
--- Makefile.am 9 Dec 2005 20:15:31 -0000       1.29
+++ Makefile.am 6 Feb 2006 04:49:16 -0000       1.30
@@ -33,6 +33,7 @@
        cl_poll.h       \
        cl_signal.h     \
        cl_pidfile.h    \
+       cl_random.h     \
        cl_syslog.h     \
        cl_uuid.h       \
        coredumps.h     \
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/include/clplumbing/cl_misc.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- cl_misc.h   20 Dec 2005 23:32:59 -0000      1.5
+++ cl_misc.h   6 Feb 2006 04:49:16 -0000       1.6
@@ -26,6 +26,4 @@
 
 int    cl_binary_to_int(const char* data, int len);
 
-int    cl_random(void);
-
 #endif




------------------------------

_______________________________________________
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 26
********************************************

Reply via email to