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: membership by zhenh from 
      ([email protected])
   2. Linux-HA CVS: mgmt by davidlee from 
      ([email protected])


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

Message: 1
Date: Thu,  2 Mar 2006 03:15:55 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: membership by zhenh from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : zhenh
Host    : 
Project : linux-ha
Module  : membership

Dir     : linux-ha/membership/ccm


Modified Files:
        ccmclient.c ccmlib.h ccmlib_memapi.c 


Log Message:
Attach the bornon value to the membership message. This patch fixs the 
split-brain bug 1092
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/membership/ccm/ccmclient.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -3 -r1.34 -r1.35
--- ccmclient.c 17 Feb 2006 05:48:24 -0000      1.34
+++ ccmclient.c 2 Mar 2006 10:15:54 -0000       1.35
@@ -1,4 +1,4 @@
-/* $Id: ccmclient.c,v 1.34 2006/02/17 05:48:24 zhenh Exp $ */
+/* $Id: ccmclient.c,v 1.35 2006/03/02 10:15:54 zhenh Exp $ */
 /* 
  * client.c: Consensus Cluster Client tracker
  *
@@ -423,6 +423,7 @@
        int             n = info->memcount;
        int             trans = info->ccm_transition_major;
        int*            member = info->ccm_member;
+       int i, j;
        
        assert( n<= MAXNODE);
 
@@ -437,13 +438,22 @@
        (void)get_quorum;
        ccm_debug(LOG_DEBUG, "quorum is %d", ccm->quorum);
 
-       memcpy(ccm->member, member, n*sizeof(int));
+
+       for (i = 0; i < n; i++) {
+               ccm->member[i].index = member[i];
+               ccm->member[i].bornon = -1;
+               for (j = 0; j < n; j ++) {
+                       if (born_arry[j].index == ccm->member[i].index) {
+                               ccm->member[i].bornon = born_arry[j].bornon;
+                       }
+               }
+       }       
 
        if(ipc_mem_message && --(ipc_mem_message->count)==0){
                delete_message(ipc_mem_message);
        }
        ipc_mem_message = create_message(ipc_mem_chk, ccm, 
-                       (sizeof(ccm_meminfo_t) + n*sizeof(int)));
+                       (sizeof(ccm_meminfo_t) + n*sizeof(born_t)));
        ipc_mem_message->count++;
 
        /* bornon array is sent in a seperate message */
@@ -541,7 +551,7 @@
        ipc_mem_chk = g_mem_chunk_new(memstr,
                                sizeof(ccm_ipc_t)+
                                sizeof(ccm_meminfo_t)+
-                               maxnode*sizeof(int), 
+                               maxnode*sizeof(born_t), 
                                MAXIPC, G_ALLOC_AND_FREE);
        ipc_born_chk = g_mem_chunk_new(bornstr,
                                sizeof(ccm_ipc_t)+
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/membership/ccm/ccmlib.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -3 -r1.19 -r1.20
--- ccmlib.h    18 Aug 2005 16:33:14 -0000      1.19
+++ ccmlib.h    2 Mar 2006 10:15:54 -0000       1.20
@@ -1,4 +1,4 @@
-/* $Id: ccmlib.h,v 1.19 2005/08/18 16:33:14 andrew Exp $ */
+/* $Id: ccmlib.h,v 1.20 2006/03/02 10:15:54 zhenh Exp $ */
 /*
  * ccmlib.h: internal definations for ccm library files.
  *
@@ -44,23 +44,23 @@
                        is changed change it also in ccm.h */
 
 size_t strnlen(const char *, size_t); /*TOBEDONE*/
-
+typedef struct born_s {
+               int index;
+               int bornon;
+} born_t;
 /* to be include by the client side of ccm */
 typedef struct ccm_meminfo_s {
        int             ev;
        int             n;
        int             trans;
        int             quorum;
-       int             member[0];
+       born_t          member[0];
 } ccm_meminfo_t;
 
 /* bornon structure sent to the client */
 typedef struct ccm_born_s {
        int        n;
-       struct born_s {
-               int index;
-               int bornon;
-       } born[0];
+       born_t     born[0];
 } ccm_born_t;
 
 typedef struct ccm_llm_s { /* information about low level membership info */
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/membership/ccm/ccmlib_memapi.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -3 -r1.39 -r1.40
--- ccmlib_memapi.c     1 Oct 2005 02:01:56 -0000       1.39
+++ ccmlib_memapi.c     2 Mar 2006 10:15:54 -0000       1.40
@@ -1,4 +1,4 @@
-/* $Id: ccmlib_memapi.c,v 1.39 2005/10/01 02:01:56 gshi Exp $ */
+/* $Id: ccmlib_memapi.c,v 1.40 2006/03/02 10:15:54 zhenh Exp $ */
 /* 
  * ccmlib_memapi.c: Consensus Cluster Membership API
  *
@@ -324,10 +324,9 @@
 
        for ( i = 0 ; i < n_members; i++ ) {
                const char *uname = NULL;
-               gpointer        gborn; /* Help make gcc warning go away */
                int     index;
 
-               index = mbrinfo->member[i];
+               index = mbrinfo->member[i].index;
 
                uname = llm_get_Id_from_Uuid(private->llm, index);
 
@@ -335,10 +334,8 @@
                
                OC_EV_SET_NODEID(newmbr,j,index);
 
-               gborn = g_hash_table_lookup(private->bornon, 
-                               GINT_TO_POINTER(mbrinfo->member[i]));
                /* gborn was an int to begin with - so this is safe */
-               born = POINTER_TO_SIZE_T(gborn);/*pointer cast as int*/
+               born = mbrinfo->member[i].bornon;
 
                /* if there is already a born entry for the
                 * node, use it. Otherwise create a born entry
@@ -347,7 +344,7 @@
                 * NOTE: born==0 implies the entry has not been
                 *      initialized.
                 */
-               OC_EV_SET_BORN(newmbr,j, born==0?trans:(born-1));
+               OC_EV_SET_BORN(newmbr,j, born);
                j++;
        }
        /* sort the m_arry */




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

Message: 2
Date: Thu,  2 Mar 2006 07:01:59 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: mgmt by davidlee from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : davidlee
Host    : 
Project : linux-ha
Module  : mgmt

Dir     : linux-ha/mgmt/daemon


Modified Files:
        mgmt_lrm.c 


Log Message:
declarations (char* ret) must precede executable statements (ARGC_CHECK(2))
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/mgmt/daemon/mgmt_lrm.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- mgmt_lrm.c  8 Dec 2005 08:54:56 -0000       1.2
+++ mgmt_lrm.c  2 Mar 2006 14:01:59 -0000       1.3
@@ -107,8 +107,10 @@
        
        GList* types;
        GList* cur;
-       ARGC_CHECK(2)
        char* ret = cl_strdup(MSG_OK);
+
+       ARGC_CHECK(2)
+
        types = lrm->lrm_ops->get_rsc_type_supported(lrm, argv[1]);
        cur = types;
        while (cur != 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 28, Issue 2
*******************************************

Reply via email to