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


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

Message: 1
Date: Sun, 19 Feb 2006 12:59:07 -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:
        messages.c 


Log Message:
Handle updates that do not come wrapped in a section

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/cib/messages.c,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -3 -r1.65 -r1.66
--- messages.c  16 Feb 2006 15:27:43 -0000      1.65
+++ messages.c  19 Feb 2006 19:59:06 -0000      1.66
@@ -1,4 +1,4 @@
-/* $Id: messages.c,v 1.65 2006/02/16 15:27:43 andrew Exp $ */
+/* $Id: messages.c,v 1.66 2006/02/19 19:59:06 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -723,7 +723,19 @@
        return cib_ok;
 }
 
-
+#define cib_update_xml_macro(parent, xml_update)                               
\
+       if(operation == CIB_UPDATE_OP_DELETE) {                         \
+               rc = delete_cib_object(parent, xml_update);             \
+               update_results(failed, xml_update, operation, rc);              
\
+                                                                       \
+       } else if(operation == CIB_UPDATE_OP_MODIFY) {                  \
+               rc = update_cib_object(parent, xml_update);             \
+               update_results(failed, xml_update, operation, rc);              
\
+                                                                       \
+       } else {                                                        \
+               rc = add_cib_object(parent, xml_update);                \
+               update_results(failed, xml_update, operation, rc);              
\
+       } 
 
 enum cib_errors
 updateList(crm_data_t *local_cib, crm_data_t *xml_section, crm_data_t *failed,
@@ -739,31 +751,24 @@
                return cib_NOSECTION;
        }
 
-       if((CIB_UPDATE_OP_NONE > operation) || (operation > CIB_UPDATE_OP_MAX)){
+       if((CIB_UPDATE_OP_NONE > operation)
+          || (operation > CIB_UPDATE_OP_MAX)){
                crm_err("Invalid operation on section %s", crm_str(section));
                return cib_operation;
        }
 
        set_node_tstamp(this_section);
 
-       xml_child_iter(
-               xml_section, a_child, 
-
-               rc = cib_ok;
-               if(operation == CIB_UPDATE_OP_DELETE) {
-                       rc = delete_cib_object(this_section, a_child);
-                       update_results(failed, a_child, operation, rc);
-
-               } else if(operation == CIB_UPDATE_OP_MODIFY) {
-                       rc = update_cib_object(this_section, a_child);
-                       update_results(failed, a_child, operation, rc);
-                                      
-               } else {
-                       rc = add_cib_object(this_section, a_child);
-                       update_results(failed, a_child, operation, rc);
-               } 
-               );
+       if(safe_str_eq(crm_element_name(xml_section), section)) {
+               xml_child_iter(xml_section, a_child, 
+                              rc = cib_ok;
+                              cib_update_xml_macro(this_section, a_child);
+                       );
 
+       } else {
+               cib_update_xml_macro(this_section, xml_section);
+       }
+       
        if(rc == cib_ok && xml_has_children(failed)) {
                rc = cib_unknown;
        }




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

Message: 2
Date: Sun, 19 Feb 2006 13:00: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/cib


Modified Files:
        callbacks.c main.c 


Log Message:
Fix for 1093: CIB messages go missing.
Change the shutdown sequence so that we both tell Heartbeat we want to
  disconnect and wait for it to take effect (which gaurentees all our prior
  messages got sent). 

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/cib/callbacks.c,v
retrieving revision 1.111
retrieving revision 1.112
diff -u -3 -r1.111 -r1.112
--- callbacks.c 17 Feb 2006 13:20:03 -0000      1.111
+++ callbacks.c 19 Feb 2006 20:00:36 -0000      1.112
@@ -1,4 +1,4 @@
-/* $Id: callbacks.c,v 1.111 2006/02/17 13:20:03 andrew Exp $ */
+/* $Id: callbacks.c,v 1.112 2006/02/19 20:00:36 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -237,7 +237,7 @@
                crm_err("Channel was NULL");
                can_connect = FALSE;
                cib_bad_connects++;
-               
+
        } else if (channel->ch_status != IPC_CONNECT) {
                crm_err("Channel was disconnected");
                can_connect = FALSE;
@@ -248,6 +248,11 @@
                can_connect = FALSE;
                cib_bad_connects++;
                
+       } else if(cib_shutdown_flag) {
+               crm_info("Ignoring new client [%d] during shutdown",
+                       channel->farside_pid);
+               return NULL;
+               
        } else {
                crm_malloc0(new_client, sizeof(cib_client_t));
                new_client->channel = channel;
@@ -1347,15 +1352,16 @@
                                (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);
 
+               crm_info("Updates flushed... exiting");
+               if(hb_conn != NULL) {
+                       hb_conn->llc_ops->signoff(hb_conn, FALSE);
                } else {
+                       crm_err("No heartbeat connection");
                        exit(LSB_EXIT_OK);
                }
        }
@@ -1379,9 +1385,6 @@
        }
        
        if (channel->ch_status != IPC_CONNECT) {
-               crm_crit("Lost connection to heartbeat service... exiting");
-               CRM_DEV_ASSERT(FALSE);
-               exit(LSB_EXIT_GENERIC);
                return FALSE;
        }
        
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/cib/main.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -3 -r1.37 -r1.38
--- main.c      14 Feb 2006 11:57:47 -0000      1.37
+++ main.c      19 Feb 2006 20:00:36 -0000      1.38
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.37 2006/02/14 11:57:47 andrew Exp $ */
+/* $Id: main.c,v 1.38 2006/02/19 20:00:36 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -364,7 +364,6 @@
        
        crm_info("Signing in with Heartbeat");
        if (hb_cluster->llc_ops->signon(hb_cluster, client_name)!= HA_OK) {
-
                crm_err("Cannot sign on with heartbeat: %s",
                        hb_cluster->llc_ops->errmsg(hb_cluster));
                return FALSE;
@@ -403,6 +402,18 @@
 void
 cib_ha_connection_destroy(gpointer user_data)
 {
+       if(cib_shutdown_flag) {
+               crm_info("Heartbeat disconnected... exiting");
+       } else {
+               crm_err("Heartbeat connection lost!  Exiting.");
+       }
+               
+       if (mainloop != NULL && g_main_is_running(mainloop)) {
+               g_main_quit(mainloop);
+               
+       } else {
+               exit(LSB_EXIT_OK);
+       }
 }
 
 




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

Message: 3
Date: Sun, 19 Feb 2006 13:02:20 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: lib by andrew from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

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

Dir     : linux-ha/lib/crm/common


Modified Files:
        ipc.c 


Log Message:


Logging for IPC_Channel->recv() failures

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/lib/crm/common/ipc.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -3 -r1.19 -r1.20
--- ipc.c       14 Feb 2006 12:12:51 -0000      1.19
+++ ipc.c       19 Feb 2006 20:02:19 -0000      1.20
@@ -1,4 +1,4 @@
-/* $Id: ipc.c,v 1.19 2006/02/14 12:12:51 andrew Exp $ */
+/* $Id: ipc.c,v 1.20 2006/02/19 20:02:19 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -323,6 +323,7 @@
 subsystem_msg_dispatch(IPC_Channel *sender, void *user_data)
 {
        int lpc = 0;
+       int rc = IPC_OK;
        IPC_Message *msg = NULL;
        ha_msg_input_t *new_input = NULL;
        gboolean all_is_well = TRUE;
@@ -335,12 +336,13 @@
                        break;
                }
 
-               if (sender->ops->recv(sender, &msg) != IPC_OK) {
-                       cl_perror("Receive failure from %d:",
-                                 sender->farside_pid);
+               rc = sender->ops->recv(sender, &msg);
+               if (rc != IPC_OK) {
+                       crm_err("Receive failure from %d: %d",
+                               sender->farside_pid, rc);
                        return !all_is_well;
-               }
-               if (msg == NULL) {
+
+               } else if (msg == NULL) {
                        crm_err("No message from %d this time",
                                sender->farside_pid);
                        continue;




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

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

Reply via email to