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


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

Message: 1
Date: Thu, 23 Feb 2006 13:12:12 -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:
        config.c 


Log Message:
Unimportant correction to config.c

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/heartbeat/config.c,v
retrieving revision 1.192
retrieving revision 1.193
diff -u -3 -r1.192 -r1.193
--- config.c    1 Feb 2006 14:59:10 -0000       1.192
+++ config.c    23 Feb 2006 20:12:12 -0000      1.193
@@ -1,4 +1,4 @@
-/* $Id: config.c,v 1.192 2006/02/01 14:59:10 alan Exp $ */
+/* $Id: config.c,v 1.193 2006/02/23 20:12:12 alan Exp $ */
 /*
  * Parse various heartbeat configuration files...
  *
@@ -384,7 +384,7 @@
                ha_log(LOG_ERR, "No authentication specified.");
                ++errcount;
        }
-       if (access(HOSTUUIDCACHEFILE, F_OK) >= 0) {
+       if (access(HOSTUUIDCACHEFILE, R_OK) >= 0) {
                if (read_cache_file(config) != HA_OK) {
                        cl_log(LOG_ERR
                        ,       "Invalid host/uuid map file [%s] - removed."
@@ -2517,6 +2517,9 @@
 
 /*
  * $Log: config.c,v $
+ * Revision 1.193  2006/02/23 20:12:12  alan
+ * Unimportant correction to config.c
+ *
  * Revision 1.192  2006/02/01 14:59:10  alan
  * Added some code to allow memory pre-reserve for heartbeat a configuration 
problem.
  *




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

Message: 2
Date: Thu, 23 Feb 2006 13:13:23 -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:
        hb_uuid.c 


Log Message:
Put in code so that we guarantee that we read the uuid and deletion
cache files before we first write them.

Also made a small correction to the uuid cache code so that it automatically
updates the cache file if we find it's out of date...

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/heartbeat/hb_uuid.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -3 -r1.20 -r1.21
--- hb_uuid.c   7 Feb 2006 17:18:24 -0000       1.20
+++ hb_uuid.c   23 Feb 2006 20:13:23 -0000      1.21
@@ -29,15 +29,20 @@
 #include <unistd.h>
 #include <clplumbing/cl_misc.h>
 
-extern int                             DoManageResources;
+extern int                     DoManageResources;
 
 #ifndef O_SYNC
 #      define O_SYNC 0
 #endif
 
-static GHashTable*                     name_table = NULL;
-static GHashTable*                     uuid_table = NULL;
-extern GList*  del_node_list;
+static GHashTable*             name_table = NULL;
+static GHashTable*             uuid_table = NULL;
+static gboolean                        nodecache_read_yet = FALSE;
+static gboolean                        delcache_read_yet = FALSE;
+extern GList*                  del_node_list;
+
+static int                     read_node_uuid_file(struct sys_config * cfg);
+static int                     read_delnode_file(struct sys_config* cfg);
 
 
 static void  remove_all(void);
@@ -197,8 +202,8 @@
                        return FALSE;
                }
 
-               cl_log(LOG_WARNING, "nodename %s"
-                      " changed to %s?", hip->nodename, nodename);     
+               cl_log(LOG_WARNING, "nodename %s uuid changed to %s"
+               ,       hip->nodename, nodename);       
                uuidtable_display();
                strncpy(hip->nodename, nodename, sizeof(hip->nodename));
                add_nametable(nodename, hip);
@@ -522,9 +527,13 @@
        const char *    finalname =     HOSTUUIDCACHEFILE;
        FILE *          f;
 
+       if (!nodecache_read_yet) {
+               read_node_uuid_file(cfg);
+       }
        (void)unlink(tmpname);
        if ((f=fopen(tmpname, "w")) == NULL) {
-               cl_perror("Cannot fopen %s for writing", tmpname);
+               cl_perror("%s: Cannot fopen %s for writing"
+               ,       __FUNCTION__, tmpname);
                return HA_FAIL;
        }
        for (j=0; j < cfg->nodecount; ++j) {
@@ -574,8 +583,13 @@
        const char *    uuidcachename = HOSTUUIDCACHEFILE;
        gboolean        outofsync = FALSE;
 
+       nodecache_read_yet = TRUE;
+       if (!cl_file_exists(uuidcachename)){
+               return HA_OK;
+       }
        if ((f=fopen(uuidcachename, "r")) == NULL) {
-               cl_perror("Cannot fopen %s for reading", uuidcachename);
+               cl_perror("%s: Cannot fopen %s for reading"
+               ,       __FUNCTION__, uuidcachename);
                return HA_FAIL;
        }
 
@@ -590,18 +604,21 @@
                }
                
                nodename2uuid(host, &curuuid);
-               if (cl_uuid_is_null(&curuuid)) {
-                       /* we should not write out any null uuid entry*/
-                       /*update_tables(host, &uu);*/
-               }else if (cl_uuid_compare(&uu, &curuuid) != 0) {
-                       outofsync=TRUE;
+               if (cl_uuid_compare(&uu, &curuuid) != 0) {
+                       if (!cl_uuid_is_null(&uu)) {
+                               update_tables(host, &uu);
+                               outofsync=TRUE;
+                       }
                }
        }
        fclose(f);
        /*
-        * If outofsync is TRUE, then we should probably write out a new
-        * uuid cache file. FIXME??
+        * If outofsync is TRUE, then we need to write out a new
+        * uuid cache file.
         */
+       if (outofsync) {
+               write_node_uuid_file(cfg);
+       }
        return rc < 0 ? HA_FAIL: HA_OK;
 }
 
@@ -614,11 +631,13 @@
        FILE *          f;
        GList*          list = NULL;
        const struct node_info* hip;
-
        
+       if (!delcache_read_yet) {
+               read_delnode_file(cfg);
+       }
        (void)unlink(tmpname);
        if ((f=fopen(tmpname, "w")) == NULL) {
-               cl_perror("%s:Cannot fopen %s for writing", 
+               cl_perror("%s: Cannot fopen %s for writing", 
                          __FUNCTION__, tmpname);
                return HA_FAIL;
        }
@@ -676,12 +695,14 @@
        const char *    filename = DELHOSTCACHEFILE;
        struct node_info thisnode;
 
+       delcache_read_yet = TRUE;
        if (!cl_file_exists(filename)){
                return HA_OK;
        }
        
        if ((f=fopen(filename, "r")) == NULL) {
-               cl_perror("Cannot fopen %s for reading", filename);
+               cl_perror("%s: Cannot fopen %s for reading"
+               ,       __FUNCTION__, filename);
                return HA_FAIL;
        }
        
@@ -695,10 +716,6 @@
        }
        fclose(f);
 
-       /*
-        * If outofsync is TRUE, then we should probably write out a new
-        * uuid cache file. FIXME??
-        */
        return rc < 0 ? HA_FAIL: HA_OK;
        
 }




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

Message: 3
Date: Thu, 23 Feb 2006 13:47:21 -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:
        hb_uuid.c 


Log Message:
Changed the code so that the first time we read the UUID table, we display it
provided debug is enabled...

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/heartbeat/hb_uuid.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -3 -r1.21 -r1.22
--- hb_uuid.c   23 Feb 2006 20:13:23 -0000      1.21
+++ hb_uuid.c   23 Feb 2006 20:47:21 -0000      1.22
@@ -619,6 +619,9 @@
        if (outofsync) {
                write_node_uuid_file(cfg);
        }
+       if (ANYDEBUG) {
+               uuidtable_display();
+       }
        return rc < 0 ? HA_FAIL: HA_OK;
 }
 




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

Message: 4
Date: Thu, 23 Feb 2006 16:01:08 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: cts by alan from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

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

Dir     : linux-ha/cts


Modified Files:
        CTS.py.in CTStests.py.in 


Log Message:
Put in a little code to make sure that we wait for nodes to come up
in the startonebyone test and after each failure...

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/cts/CTS.py.in,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -3 -r1.50 -r1.51
--- CTS.py.in   20 Feb 2006 13:05:18 -0000      1.50
+++ CTS.py.in   23 Feb 2006 23:01:08 -0000      1.51
@@ -893,6 +893,8 @@
 
 
 class NodeStatus:
+    def __init__(self, Env):
+        self.Env = Env
     def IsNodeBooted(self, node):
         '''Return TRUE if the given node is booted (responds to pings'''
         return os.system("@PING@ -nq -c1 @PING_TIMEOUT_OPT@ %s >/dev/null 
2>&1" % node) == 0
@@ -936,7 +938,7 @@
 as they might have been rebooted or crashed for some reason beforehand.
 ''')
     def __init__(self, Env):
-       self.ns=NodeStatus()
+       self.ns=NodeStatus(Env)
 
     def IsApplicable(self):
         '''InitClusterManager is so generic it is always Applicable'''
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/cts/CTStests.py.in,v
retrieving revision 1.137
retrieving revision 1.138
diff -u -3 -r1.137 -r1.138
--- CTStests.py.in      14 Feb 2006 12:19:25 -0000      1.137
+++ CTStests.py.in      23 Feb 2006 23:01:08 -0000      1.138
@@ -62,6 +62,7 @@
         self.Scenario = scenario
         self.Tests = []
         self.Audits = []
+       self.ns=CTS.NodeStatus(self.Env)
 
         for test in tests:
             if not issubclass(test.__class__, CTSTest):
@@ -160,6 +161,7 @@
         if not self.Scenario.SetUp(self.CM):
             return None
 
+       self.ns.WaitForAllNodesToComeUp(self.CM.Env["nodes"])
         testcount=1
         time.sleep(30)
 
@@ -188,6 +190,7 @@
             else:
                 self.incr("failure")
                 self.CM.log("Test %s (%s) \t[FAILED]" %(test.name,nodechoice))
+               self.ns.WaitForAllNodesToComeUp(self.CM.Env["nodes"])
                 # Better get the current info from the cluster...
                 self.CM.statall()
                # Make sure logging is working and we have enough disk space...
@@ -715,6 +718,7 @@
         self.name="StartOnebyOne"
         self.stopall = SimulStopLite(cm)
         self.start = StartTest(cm)
+        self.ns=CTS.NodeStatus(cm.Env)
 
     def __call__(self, dummy):
         '''Perform the 'StartOnebyOne' test. '''
@@ -730,6 +734,7 @@
         failed=[]
         self.starttime=time.time()
         for node in self.CM.Env["nodes"]:
+           self.ns.WaitForAllNodesToComeUp(self.CM.Env["nodes"])
             if not self.start(node):
                 failed.append(node)
 




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

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

Reply via email to