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


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

Message: 1
Date: Fri,  9 Dec 2005 13:15:33 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: membership by gshi from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

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

Dir     : linux-ha/membership/ccm


Modified Files:
        ccmclient.c 


Log Message:
bug 338: Make quorum architecture pluggable 


===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/membership/ccm/ccmclient.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -3 -r1.31 -r1.32
--- ccmclient.c 6 Oct 2005 20:03:16 -0000       1.31
+++ ccmclient.c 9 Dec 2005 20:15:31 -0000       1.32
@@ -1,4 +1,4 @@
-/* $Id: ccmclient.c,v 1.31 2005/10/06 20:03:16 gshi Exp $ */
+/* $Id: ccmclient.c,v 1.32 2005/12/09 20:15:31 gshi Exp $ */
 /* 
  * client.c: Consensus Cluster Client tracker
  *
@@ -23,6 +23,9 @@
  */
 #include <ccm.h>
 #include <ccmlib.h>
+#include <clplumbing/cl_plugin.h>
+#include <clplumbing/cl_quorum.h>
+#include <clplumbing/cl_tiebreaker.h>
 
 typedef struct ccm_client_s {
        int     ccm_clid;
@@ -336,30 +339,47 @@
 }
 
 
-/* a sophisticated quorum algorithm has to be introduced here
- *  currently we are just using the simplest algorithm
- */
 static gboolean
-mem_quorum(llm_info_t* llm, int member_count)
+get_quorum(ccm_info_t* info)
 {
-       int     total_count = llm->nodecount;
-       
-       cl_log(LOG_INFO, "n_member=%d, nodecount=%d",
-              member_count, total_count); 
+       static struct hb_quorum_fns* funcs = NULL;
+       static struct hb_tiebreaker_fns* tiebreaker_funcs = NULL;
+       const char* quorum_plugin = "classic";
+       const char* tiebreaker_plugin = NULL;
+       int rc;
+
+       if (funcs == NULL){
+               funcs = cl_load_plugin("quorum", quorum_plugin);
+               if (funcs == NULL){
+                       cl_log(LOG_ERR, "%s: loading plugin %s failed",
+                              __FUNCTION__, quorum_plugin);
+                       return FALSE;
+               }
+       }
        
-       /* XXX REVISIT TODO: This is a temporary WORK-AROUND for the two
-        * node clusters. With one node missing, always assume quorum.
-        * This will be farmed out to plugins later! */
-       if (total_count == 2) {
-               cl_log(LOG_INFO, "Asserting quorum for two node cluster!");
+        rc = funcs->getquorum(info->memcount, info->llm.nodecount);
+
+       if (rc == QUORUM_YES){
                return TRUE;
+       }else if (rc ==  QUORUM_NO){
+               return FALSE;
        }
        
-       if(member_count >=  total_count/2 + 1){
-               return TRUE;
+       if (tiebreaker_funcs == NULL){
+               if ( tiebreaker_plugin == NULL){
+                       return FALSE;
+               }
+               
+               tiebreaker_funcs = cl_load_plugin("tiebreaker", 
tiebreaker_plugin);
+               if (tiebreaker_funcs == NULL){
+                       cl_log(LOG_ERR, "%s: loading plugin %s failed",
+                              __FUNCTION__, tiebreaker_plugin);
+                       return FALSE;
+               }
        }
        
-       return FALSE;
+       return tiebreaker_funcs->break_tie(info->memcount, info->llm.nodecount);
+       
 }
 
 static void
@@ -392,7 +412,10 @@
        ccm->ev = CCM_NEW_MEMBERSHIP;
        ccm->n = n;
        ccm->trans = trans;
-       ccm->quorum = mem_quorum(&info->llm, n);
+       ccm->quorum = get_quorum(info);
+       (void)get_quorum;
+       cl_log(LOG_INFO, "quorum is %d", ccm->quorum);
+
        memcpy(ccm->member, member, n*sizeof(int));
 
        if(ipc_mem_message && --(ipc_mem_message->count)==0){




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

Message: 2
Date: Fri,  9 Dec 2005 14:41:25 -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:
Fixed a minor complaint from amd64, plus added version information, minor URL 
correction, etc.

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/heartbeat/config.c,v
retrieving revision 1.184
retrieving revision 1.185
diff -u -3 -r1.184 -r1.185
--- config.c    9 Dec 2005 16:07:38 -0000       1.184
+++ config.c    9 Dec 2005 21:41:24 -0000       1.185
@@ -1,4 +1,4 @@
-/* $Id: config.c,v 1.184 2005/12/09 16:07:38 blaschke Exp $ */
+/* $Id: config.c,v 1.185 2005/12/09 21:41:24 alan Exp $ */
 /*
  * Parse various heartbeat configuration files...
  *
@@ -860,7 +860,10 @@
        if (wikiout) {
                printf("The [wiki:ha.cf ha.cf] directives that have default"
                " values are shown in the table below along with the default"
-               " values and a brief description.\n\n");
+               " values and a brief description.\n");
+               printf("This is the output from {{{heartbeat -DW}}}"
+               " (version %s)\n\n"
+               ,       VERSION);
 
                printf("||\'\'%s\'\'||\'\'%s\'\'||\'\'%s\'\'||\n"
                ,       lcolhdr, ccolhdr, rcolhdr);
@@ -883,7 +886,7 @@
                                        }
                                }
 
-                               printf("||[wiki:ha.cf/%sDirective"
+                               printf("||[wiki:Self:ha.cf/%sDirective"
                                " %s]||%s||%s||\n"
                                ,       WikiName
                                ,       Directives[j].name
@@ -905,7 +908,7 @@
                printf("%-*.*s  %-*.*s  %s\n", lmaxlen, lmaxlen, lcolhdr
                ,       cmaxlen, cmaxlen, ccolhdr, rcolhdr);
                /* this 4 comes from the pair of 2 blanks between columns */
-               printf("%-*.*s\n", sizeof(dashes)
+               printf("%-*.*s\n", (int)sizeof(dashes)
                ,       lmaxlen + cmaxlen + rmaxlen + 4, dashes);
 
                for (j=0; j < DIMOF(Directives); ++j) {
@@ -2356,15 +2359,15 @@
 static int
 set_autojoin(const char* value)
 {
-       if (strcmp(value, "none") == 0) {
+       if (strcasecmp(value, "none") == 0) {
                config->rtjoinconfig = HB_JOIN_NONE;
                return HA_OK;
        }
-       if (strcmp(value, "other") == 0) {
+       if (strcasecmp(value, "other") == 0) {
                config->rtjoinconfig = HB_JOIN_OTHER;
                return HA_OK;
        }
-       if (strcmp(value, "any") == 0) {
+       if (strcasecmp(value, "any") == 0) {
                config->rtjoinconfig = HB_JOIN_ANY;
                return HA_OK;
        }
@@ -2390,6 +2393,9 @@
 
 /*
  * $Log: config.c,v $
+ * Revision 1.185  2005/12/09 21:41:24  alan
+ * Fixed a minor complaint from amd64, plus added version information, minor 
URL correction, etc.
+ *
  * Revision 1.184  2005/12/09 16:07:38  blaschke
  *
  * Bug 990 - Added -D option to tell heartbeat to display default directive




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

Message: 3
Date: Fri,  9 Dec 2005 15:33:11 -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:
Disallowed the nomalpoll option.
Fixed some text that I broke :-(

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/heartbeat/config.c,v
retrieving revision 1.185
retrieving revision 1.186
diff -u -3 -r1.185 -r1.186
--- config.c    9 Dec 2005 21:41:24 -0000       1.185
+++ config.c    9 Dec 2005 22:33:11 -0000       1.186
@@ -1,4 +1,4 @@
-/* $Id: config.c,v 1.185 2005/12/09 21:41:24 alan Exp $ */
+/* $Id: config.c,v 1.186 2005/12/09 22:33:11 alan Exp $ */
 /*
  * Parse various heartbeat configuration files...
  *
@@ -93,7 +93,6 @@
 static int set_generation_method(const char *);
 static int set_realtime(const char *);
 static int set_debuglevel(const char *);
-static int set_normalpoll(const char *);
 static int set_api_authorization(const char *);
 static int set_msgfmt(const char*);
 static int set_logdaemon(const char*);
@@ -105,6 +104,9 @@
 static int set_release2mode(const char*);
 static int set_autojoin(const char*);
 static int set_uuidfrom(const char*);
+#ifdef ALLOWPOLLCHOICE
+  static int set_normalpoll(const char *);
+#endif
 
 /*
  * Each of these parameters is is automatically recorded by
@@ -138,7 +140,9 @@
 , {KEY_GEN_METH,  set_generation_method, TRUE, "file", "protocol generation 
computation method"}
 , {KEY_REALTIME,  set_realtime, TRUE, "true", "enable realtime behavior?"}
 , {KEY_DEBUGLEVEL,set_debuglevel, TRUE, NULL, "debug level"}
+#ifdef ALLOWPOLLCHOICE
 , {KEY_NORMALPOLL,set_normalpoll, TRUE, "true", "Use system poll(2) function?"}
+#endif
 , {KEY_MSGFMT,    set_msgfmt, TRUE, "classic", "message format in the wire"}
 , {KEY_LOGDAEMON, set_logdaemon, TRUE, NULL, "use logging daemon"}  
 , {KEY_CONNINTVAL,set_logdconntime, TRUE, "60", "the interval to reconnect to 
logd"}  
@@ -858,11 +862,12 @@
        }
 
        if (wikiout) {
-               printf("The [wiki:ha.cf ha.cf] directives that have default"
-               " values are shown in the table below along with the default"
-               " values and a brief description.\n");
-               printf("This is the output from {{{heartbeat -DW}}}"
-               " (version %s)\n\n"
+               printf("##Put this output in the ha.cf/DefaultDirectives"
+               " page\n");
+               printf("The [wiki:ha.cf ha.cf] directives with default"
+               " values are shown below - along with a brief description.\n");
+               printf("This was produced by {{{heartbeat -DW}}}"
+               " ''# (version %s)''\n\n"
                ,       VERSION);
 
                printf("||\'\'%s\'\'||\'\'%s\'\'||\'\'%s\'\'||\n"
@@ -886,7 +891,7 @@
                                        }
                                }
 
-                               printf("||[wiki:Self:ha.cf/%sDirective"
+                               printf("||[wiki:ha.cf/%sDirective"
                                " %s]||%s||%s||\n"
                                ,       WikiName
                                ,       Directives[j].name
@@ -1858,6 +1863,7 @@
        return(HA_FAIL);
 }
 
+#ifdef ALLOWPOLLCHOICE
 static int
 set_normalpoll(const char * value)
 {
@@ -1869,6 +1875,7 @@
        }
        return ret;
 }
+#endif
 static int
 set_msgfmt(const char* value)
 {
@@ -2393,6 +2400,10 @@
 
 /*
  * $Log: config.c,v $
+ * Revision 1.186  2005/12/09 22:33:11  alan
+ * Disallowed the nomalpoll option.
+ * Fixed some text that I broke :-(
+ *
  * Revision 1.185  2005/12/09 21:41:24  alan
  * Fixed a minor complaint from amd64, plus added version information, minor 
URL correction, etc.
  *




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

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


End of Linux-ha-cvs Digest, Vol 25, Issue 23
********************************************

Reply via email to