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


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

Message: 1
Date: Tue, 14 Feb 2006 04:57:47 -0700 (MST)
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 io.c main.c 


Log Message:
Use Alan's new asynchronous child process code to write out the CIB
 - we dont block (so its faster) 
 - we dont need to make a acopy of the CIB since we're in a new memory space
   (so its even faster)
 - we can aggregate writes during peak times

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/cib/callbacks.c,v
retrieving revision 1.107
retrieving revision 1.108
diff -u -3 -r1.107 -r1.108
--- callbacks.c 10 Feb 2006 15:01:31 -0000      1.107
+++ callbacks.c 14 Feb 2006 11:57:47 -0000      1.108
@@ -1,4 +1,4 @@
-/* $Id: callbacks.c,v 1.107 2006/02/10 15:01:31 andrew Exp $ */
+/* $Id: callbacks.c,v 1.108 2006/02/14 11:57:47 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -1244,7 +1244,7 @@
                        if(seen < timeout) {
                                crm_debug_4("Updating seen count for msg from 
client %s",
                                            client->id);
-                               seen += 1;
+                               seen += 10;
                                ha_msg_mod_int(msg, F_CIB_SEENCOUNT, seen);
                                list = list->next;
                                continue;
@@ -1325,18 +1325,29 @@
           && cib_shutdown_flag
           && g_hash_table_size(client_list) == 0) {
                IPC_Channel *ipc = NULL;
+               IPC_Queue *send_q = NULL;
                crm_info("All clients disconnected... flushing updates");
 
                /* wait for HA messages to be sent */
-               if(hb_conn != NULL) {
+               while(hb_conn != NULL) {
                        ipc = hb_conn->llc_ops->ipcchan(hb_conn);
-               }
-               if(ipc != NULL) {
+                       if(ipc == NULL || ipc->ch_status != IPC_CONNECT) {
+                               break;
+                       }
+                       
+                       send_q = ipc->send_queue;
+                       if(send_q == NULL || send_q->current_qlen == 0) {
+                               break;
+                       }
+
+                       crm_err("Waiting on %d queued messages to be sent",
+                               (int)send_q->current_qlen);
+                       
                        ipc->ops->waitout(ipc);
                        /* BUG: give heartbeat time to send our messages out */ 
                        sleep(2);
                }
-              
+               
                crm_info("Updates flushed... exiting");
                if (mainloop != NULL && g_main_is_running(mainloop)) {
                        g_main_quit(mainloop);
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/cib/io.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -3 -r1.45 -r1.46
--- io.c        8 Feb 2006 22:12:06 -0000       1.45
+++ io.c        14 Feb 2006 11:57:47 -0000      1.46
@@ -1,4 +1,4 @@
-/* $Id: io.c,v 1.45 2006/02/08 22:12:06 andrew Exp $ */
+/* $Id: io.c,v 1.46 2006/02/14 11:57:47 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -40,6 +40,7 @@
 #include <crm/common/xml.h>
 #include <crm/common/util.h>
 #include <clplumbing/cl_misc.h>
+#include <clplumbing/lsb_exitcodes.h>
 
 #include <cibprimatives.h>
 
@@ -77,9 +78,11 @@
 extern gboolean cib_have_quorum;
 extern GHashTable *peer_hash;
 extern GHashTable *ccm_membership;
+extern GTRIGSource *cib_writer;
 
 int set_connected_peers(crm_data_t *xml_obj);
 void GHFunc_count_peers(gpointer key, gpointer value, gpointer user_data);
+int write_cib_contents(gpointer p);
 
 /*
  * It is the callers responsibility to free the output of this function
@@ -387,43 +390,8 @@
                }
                
                if(cib_writes_enabled) {
-                       crm_data_t *cib_copy_status = NULL;
-                       crm_data_t *cib_copy_no_status = NULL;
-
-                       crm_debug_3("Writing CIB out to %s", CIB_FILENAME);
-                       CRM_DEV_ASSERT(new_cib != NULL);
-
-                       /* Given that we discard the status section on startup
-                        *   there is no point writing it out in the first place
-                        *   since users just get confused by it
-                        *
-                        * Although, it does help me once in a while
-                        *
-                        * So make a copy of the CIB and delete the status
-                        *   section before we write it out
-                        * Perhaps not the most efficient thing to do but
-                        *   it will work reliably
-                        */
-                       cib_copy_no_status = copy_xml(new_cib);
-                       cib_copy_status = find_xml_node(
-                               cib_copy_no_status, XML_CIB_TAG_STATUS, TRUE);
-                       CRM_DEV_ASSERT(cib_copy_status != NULL);
-
-                       free_xml_from_parent(
-                               cib_copy_no_status, cib_copy_status);
-                       
-                       local_rc = write_xml_file(
-                               cib_copy_no_status, filename);
-
-                       CRM_DEV_ASSERT(local_rc != -1 && local_rc != 0);
-
-                       if(crm_assert_failed) {
-                               crm_err("Changes activated but couldn't"
-                                       " be written to disk");
-                               error_code = -2;
-                       }
-                       
-                       free_xml(cib_copy_no_status);                   
+                       crm_debug_2("Triggering CIB write");
+                       G_main_set_trigger(cib_writer);
                }
        }
 
@@ -472,6 +440,47 @@
     
 }
 
+int write_cib_contents(gpointer p) 
+{
+       int rc = 0;
+       crm_data_t *cib_status_root = NULL;
+
+       /* we can scribble on "the_cib" here and not affect the parent */
+       const char *epoch = crm_element_value(the_cib, XML_ATTR_GENERATION);
+       const char *updates = crm_element_value(the_cib, XML_ATTR_NUMUPDATES);
+       const char *admin_epoch = crm_element_value(
+               the_cib, XML_ATTR_GENERATION_ADMIN);
+       
+       crm_info("Writing version %s.%s.%s of the CIB to disk",
+                admin_epoch?admin_epoch:"0",
+                epoch?epoch:"0", updates?updates:"0");
+       
+       /* Given that we discard the status section on startup
+        *   there is no point writing it out in the first place
+        *   since users just get confused by it
+        *
+        * Although, it does help me once in a while
+        *
+        * So delete the status section before we write it out
+        */
+       cib_status_root = find_xml_node(the_cib, XML_CIB_TAG_STATUS, TRUE);
+       CRM_DEV_ASSERT(cib_status_root != NULL);
+       
+       if(cib_status_root != NULL) {
+               free_xml_from_parent(the_cib, cib_status_root);
+       }
+       
+       rc = write_xml_file(the_cib, CIB_FILENAME);
+
+       CRM_DEV_ASSERT(rc != -1 && rc != 0);
+       if(crm_assert_failed) {
+               crm_err("Changes activated but couldn't be written to disk");
+               exit(LSB_EXIT_GENERIC);
+       }
+       exit(LSB_EXIT_OK);
+       return HA_OK;
+}
+
 void
 set_transition(crm_data_t *xml_obj)
 {
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/cib/main.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -3 -r1.36 -r1.37
--- main.c      8 Feb 2006 22:12:06 -0000       1.36
+++ main.c      14 Feb 2006 11:57:47 -0000      1.37
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.36 2006/02/08 22:12:06 andrew Exp $ */
+/* $Id: main.c,v 1.37 2006/02/14 11:57:47 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -71,8 +71,10 @@
 void cib_ha_connection_destroy(gpointer user_data);
 gboolean startCib(const char *filename);
 extern gboolean cib_msg_timeout(gpointer data);
+extern int write_cib_contents(gpointer p);
 
 ll_cluster_t *hb_conn = NULL;
+GTRIGSource *cib_writer = NULL;
 
 #define OPTARGS        "hV"
 
@@ -87,6 +89,13 @@
        crm_log_init(crm_system_name);
        G_main_add_SignalHandler(
                G_PRIORITY_HIGH, SIGTERM, cib_shutdown, NULL, NULL);
+       
+       cib_writer = G_main_add_tempproc_trigger(                       
+               G_PRIORITY_LOW, write_cib_contents, "write_cib_contents",
+               NULL, NULL, NULL);
+
+       EnableProcLogging();
+       set_sigchld_proctrack(G_PRIORITY_HIGH);
 
        client_list = g_hash_table_new(g_str_hash, g_str_equal);
        peer_hash = g_hash_table_new(g_str_hash, g_str_equal);
@@ -314,7 +323,7 @@
                mainloop = g_main_new(FALSE);
                crm_info("Starting %s mainloop", crm_system_name);
 
-               Gmain_timeout_add(crm_get_msec("1s"), cib_msg_timeout, NULL);
+               Gmain_timeout_add(crm_get_msec("10s"), cib_msg_timeout, NULL);
                Gmain_timeout_add(
                        crm_get_msec(cib_stat_interval), cib_stats, NULL); 
                




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

Message: 2
Date: Tue, 14 Feb 2006 04:59:36 -0700 (MST)
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/pengine


Modified Files:
        graph.c 


Log Message:
Bug 1084: If an unmanaged resource exists on a node we want to shut down, 
  we cant stop it and therefor cant shutdown the node.
Detect this and ignore unmanaged resources.

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/pengine/graph.c,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -3 -r1.73 -r1.74
--- graph.c     11 Jan 2006 12:46:53 -0000      1.73
+++ graph.c     14 Feb 2006 11:59:36 -0000      1.74
@@ -1,4 +1,4 @@
-/* $Id: graph.c,v 1.73 2006/01/11 12:46:53 andrew Exp $ */
+/* $Id: graph.c,v 1.74 2006/02/14 11:59:36 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -192,6 +192,10 @@
        slist_iter(
                rsc, resource_t, node->details->running_rsc, lpc,
 
+               if(rsc->is_managed == FALSE) {
+                       continue;
+               }
+               
                custom_action_order(
                        rsc, stop_key(rsc), NULL,
                        NULL, crm_strdup(CRM_OP_SHUTDOWN), shutdown_op,




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

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

Reply via email to