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: debian by zhenh from 
      ([email protected])
   2. Linux-HA CVS: lib by zhenh from  ([email protected])
   3. Linux-HA CVS: membership by zhenh from 
      ([email protected])
   4. Linux-HA CVS: crm by andrew from 
      ([email protected])


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

Message: 1
Date: Mon, 29 May 2006 02:55:24 -0600 (MDT)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: debian by zhenh from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

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

Dir     : linux-ha/debian


Modified Files:
        heartbeat-2.files 


Log Message:
Generalize the quorum/tiebreaker module structure
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/debian/heartbeat-2.files,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -3 -r1.18 -r1.19
--- heartbeat-2.files   28 May 2006 00:45:07 -0000      1.18
+++ heartbeat-2.files   29 May 2006 08:55:24 -0000      1.19
@@ -124,6 +124,7 @@
 usr/lib/heartbeat/plugins/RAExec/ocf.so
 usr/lib/heartbeat/plugins/RAExec/stonith.so
 usr/lib/heartbeat/plugins/quorum/majority.so
+usr/lib/heartbeat/plugins/quorum/twonodes.so
 usr/lib/heartbeat/plugins/test/test.so
 usr/lib/heartbeat/plugins/tiebreaker/twonodes.so
 usr/lib/heartbeat/ptest




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

Message: 2
Date: Mon, 29 May 2006 02:55:25 -0600 (MDT)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: lib by zhenh from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

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

Dir     : linux-ha/lib/plugins/quorum


Modified Files:
        Makefile.am 
Added Files:
        twonodes.c 


Log Message:
Generalize the quorum/tiebreaker module structure
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/lib/plugins/quorum/Makefile.am,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- Makefile.am 16 Dec 2005 02:12:00 -0000      1.2
+++ Makefile.am 29 May 2006 08:55:24 -0000      1.3
@@ -33,8 +33,12 @@
 
 halibdir               = $(libdir)/@HB_PKG@
 plugindir              = $(halibdir)/plugins/quorum
-plugin_LTLIBRARIES     = majority.la
+plugin_LTLIBRARIES     = majority.la twonodes.la
 
 majority_la_SOURCES            = majority.c
 majority_la_LDFLAGS            = -export-dynamic -module -avoid-version -lz
 majority_la_LIBADD             = $(top_builddir)/replace/libreplace.la 
+
+twonodes_la_SOURCES            = twonodes.c
+twonodes_la_LDFLAGS            = -export-dynamic -module -avoid-version -lz
+twonodes_la_LIBADD             = $(top_builddir)/replace/libreplace.la 




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

Message: 3
Date: Mon, 29 May 2006 02:55:25 -0600 (MDT)
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 


Log Message:
Generalize the quorum/tiebreaker module structure
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/membership/ccm/ccmclient.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -3 -r1.40 -r1.41
--- ccmclient.c 13 Apr 2006 09:08:37 -0000      1.40
+++ ccmclient.c 29 May 2006 08:55:24 -0000      1.41
@@ -1,4 +1,4 @@
-/* $Id: ccmclient.c,v 1.40 2006/04/13 09:08:37 zhenh Exp $ */
+/* $Id: ccmclient.c,v 1.41 2006/05/29 08:55:24 zhenh Exp $ */
 /* 
  * client.c: Consensus Cluster Client tracker
  *
@@ -58,6 +58,7 @@
 static gboolean membership_ready     = FALSE;
 static void refresh_llm_msg(llm_info_t *llm);
 
+static GList* quorum_list = NULL;
 
 /* 
  * the fully initialized clients.
@@ -308,62 +309,60 @@
 static gboolean
 get_quorum(ccm_info_t* info)
 {
-       static struct hb_quorum_fns* funcs = NULL;
-       static struct hb_tiebreaker_fns* tiebreaker_funcs = NULL;
-       const char* quorum_plugin = NULL;
-       const char* tiebreaker_plugin = NULL;
+       struct hb_quorum_fns* funcs = NULL;
+       const char* quorum_env = NULL;
+       char* quorum_str = NULL;
+       char* end = NULL;
+       char* begin = NULL;
+       GList* cur = NULL;
        int rc;
        
-       if (funcs == NULL){
-               quorum_plugin = cl_get_env(QUORUM_S);
-               if (quorum_plugin == NULL){
-                       ccm_debug2(LOG_DEBUG, "No quorum selected,"
-                              "using default quorum plugin(majority)");
-                       quorum_plugin  = "majority";
+       if (quorum_list == NULL){
+               quorum_env = cl_get_env(QUORUM_S);
+               if (quorum_env == NULL){
+                       ccm_debug(LOG_DEBUG, "No quorum selected,"
+                              "using default quorum 
plugin(majority:twonodes)");
+                       quorum_str = cl_strdup("majority:twonodes");
                }
-       }
-       
-       if (tiebreaker_funcs == NULL){
-               tiebreaker_plugin = cl_get_env(TIEBREAKER_S);
-               if (tiebreaker_plugin == NULL){
-                       ccm_debug2(LOG_DEBUG, "No tiebreaker selected,"
-                              "using default tiebreaker plugin(twonodes)");
-                       tiebreaker_plugin = "twonodes";
+               else {
+                       quorum_str = cl_strdup(quorum_env);
                }
                
-       }
-       
-       if (funcs == NULL){
-               funcs = cl_load_plugin("quorum", quorum_plugin);
-               if (funcs == NULL){
-                       ccm_log(LOG_ERR, "%s: loading plugin %s failed",
-                              __FUNCTION__, quorum_plugin);
-                       return FALSE;
+               begin = quorum_str;
+               while (begin != NULL) {
+                       end = strchr(begin, ':');
+                       if (end != NULL) {
+                               *end = 0;
+                       }
+                       funcs = cl_load_plugin("quorum", begin);
+                       if (funcs == NULL){
+                               ccm_log(LOG_ERR, "%s: loading plugin %s failed",
+                                      __FUNCTION__, begin);
+                       }
+                       else {
+                               quorum_list = g_list_append(quorum_list, funcs);
+                       }
+                       begin = (end == NULL)? NULL:end+1;
                }
+               cl_free(quorum_str);
        }
-       
-        rc = funcs->getquorum(info->memcount, info->llm.nodecount);
-
-       if (rc == QUORUM_YES){
-               return TRUE;
-       }else if (rc ==  QUORUM_NO){
-               return FALSE;
-       }
-       
-       if (tiebreaker_funcs == NULL){
-               if ( tiebreaker_plugin == NULL){
-                       return FALSE;
-               }
                
-               tiebreaker_funcs = cl_load_plugin("tiebreaker", 
tiebreaker_plugin);
-               if (tiebreaker_funcs == NULL){
-                       ccm_log(LOG_ERR, "%s: loading plugin %s failed",
-                              __FUNCTION__, tiebreaker_plugin);
+       cur = g_list_first(quorum_list);
+       while (cur != NULL) {
+               funcs = (struct hb_quorum_fns*)cur->data;
+               rc = funcs->getquorum(info->memcount, info->llm.nodecount);
+               if (rc == QUORUM_YES){
+                       return TRUE;
+               }
+               else if (rc == QUORUM_NO){
                        return FALSE;
                }
+               cur = g_list_next(cur);
        }
+       ccm_debug(LOG_ERR, "all quorum plugins can't make a decision! "
+                       "assume lost quorum");
        
-       return tiebreaker_funcs->break_tie(info->memcount, info->llm.nodecount);
+       return FALSE;
        
 }
 




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

Message: 4
Date: Mon, 29 May 2006 03:36:00 -0600 (MDT)
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:
Use the complete list of members

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/cib/callbacks.c,v
retrieving revision 1.122
retrieving revision 1.123
diff -u -3 -r1.122 -r1.123
--- callbacks.c 15 May 2006 10:21:04 -0000      1.122
+++ callbacks.c 29 May 2006 09:36:00 -0000      1.123
@@ -1,4 +1,4 @@
-/* $Id: callbacks.c,v 1.122 2006/05/15 10:21:04 andrew Exp $ */
+/* $Id: callbacks.c,v 1.123 2006/05/29 09:36:00 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -1658,13 +1658,14 @@
                                        ccm_membership, a_node.node_uname);     
                        }
                }
-               if(membership != NULL && membership->m_n_in != 0) {
-                       members = membership->m_n_in;
-                       offset = membership->m_in_idx;
+               
+               if(membership != NULL && membership->m_n_member != 0) {
+                       members = membership->m_n_member;
+                       offset = membership->m_memb_idx;
                        for(lpc = 0; lpc < members; lpc++) {
                                oc_node_t a_node = 
membership->m_array[lpc+offset];
                                char *uname = crm_strdup(a_node.node_uname);
-                               crm_info("New peer: %s", uname);
+                               crm_info("PEER: %s", uname);
                                g_hash_table_replace(
                                        ccm_membership, uname, uname);  
                        }




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

_______________________________________________
Linux-ha-cvs mailing list
[email protected]
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs


End of Linux-ha-cvs Digest, Vol 30, Issue 92
********************************************

Reply via email to