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


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

Message: 1
Date: Wed,  8 Feb 2006 15:12:06 -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/cib


Modified Files:
        cib_native.c 


Log Message:
Fix for a crash bug found by Peter Kruse.
Steps to reproduce on his system:
  node2# crm_resource -M -r rg1 -H ha-test-1
  node1# crm_resource -U -r rg1
  node1# crm_mon -1
The -U command deletes the constraints, at some point between this and the
 next query (quite probably during activation) the CIB corrupted itself and
 dumped core.
In the process of fixing this, I:
 - cleaned up the CIB activation code
 - made sure wraparounds of the per-connection cib operation id is handled
   correctly
 - simplified the IPC loop handling "syncronous" CIB calls in cib_native.c

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/lib/crm/cib/cib_native.c,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -3 -r1.53 -r1.54
--- cib_native.c        2 Feb 2006 08:59:52 -0000       1.53
+++ cib_native.c        8 Feb 2006 22:12:06 -0000       1.54
@@ -429,6 +429,15 @@
        }
 
        if(rc == HA_OK) {
+               cib->call_id++;
+               /* prevent call_id from being negative (or zero) and conflicting
+                *    with the cib_errors enum
+                * use 2 because we use it as (cib->call_id - 1) below
+                */
+               if(cib->call_id < 1) {
+                       cib->call_id = 1;
+               }
+       
                op_msg = cib_create_op(
                        cib->call_id, op, host, section, data, call_options);
                if(op_msg == NULL) {
@@ -436,17 +445,10 @@
                }
        }
        
-       cib->call_id++;
-       /* prevent call_id from being negative (or zero) and conflicting
-        *    with the cib_errors enum
-        * use 2 because we use it as (cib->call_id - 1) below
-        */
-       if(cib->call_id < 2) {
-               cib->call_id = 2;
-       }
-       
        crm_debug_3("Sending %s message to CIB service", op);
-       if(send_ipc_message(native->command_channel, op_msg) == FALSE) {
+       if(rc != HA_OK) {
+
+       } else if(send_ipc_message(native->command_channel, op_msg) == FALSE) {
                crm_err("Sending message to CIB service FAILED");
                return cib_send_failed;
 
@@ -462,68 +464,64 @@
 
        } else if(!(call_options & cib_sync_call)) {
                crm_debug_3("Async call, returning");
-               return cib->call_id - 1;
+               return cib->call_id;
        }
 
        rc = IPC_OK;
        crm_debug_3("Waiting for a syncronous reply");
-       while(native->command_channel->ops->get_chan_status(
-                     native->command_channel) == IPC_CONNECT) {
-
-               rc = native->command_channel->ops->waitin(
-                       native->command_channel);
+       while(IPC_ISRCONN(native->command_channel)) {
+               int reply_id = -1;
+               int msg_id = cib->call_id;
 
-               if(rc == IPC_OK) {
-                       int msg_id = cib->call_id - 1;
-                       int reply_id = -1;
-                       op_reply = msgfromIPC_noauth(native->command_channel);
-                       if(op_reply == NULL) {
-                               break;
-                       }
-                       CRM_DEV_ASSERT(HA_OK == ha_msg_value_int(
-                                              op_reply, F_CIB_CALLID, 
&reply_id));
+               op_reply = msgfromIPC(native->command_channel, MSG_ALLOWINTR);
+               if(op_reply == NULL) {
+                       break;
+               }
+               CRM_DEV_ASSERT(HA_OK == ha_msg_value_int(
+                                      op_reply, F_CIB_CALLID, &reply_id));
 
-                       CRM_DEV_ASSERT(reply_id <= msg_id);
+               CRM_DEV_ASSERT(reply_id <= msg_id);
                        
-                       if(reply_id == msg_id) {
-                               break;
-
-                       } else if(reply_id < msg_id) {
-                               crm_debug("Recieved old reply: %d (wanted %d)",
-                                       reply_id, msg_id);
-                               crm_log_message_adv(
-                                       LOG_MSG, "Old reply", op_reply);
-                       } else {
-                               crm_err("Received a __future__ reply:"
-                                       " %d (wanted %d)", reply_id, msg_id);
-                       }
-                       crm_msg_del(op_reply);
-
-               } else if(rc == IPC_INTR) {
-                       crm_debug_3("a signal arrived, retry the read");
-
-               } else {
+               if(reply_id == msg_id) {
                        break;
+                       
+               } else if(reply_id < msg_id) {
+                       crm_debug("Recieved old reply: %d (wanted %d)",
+                                 reply_id, msg_id);
+                       crm_log_message_adv(
+                               LOG_MSG, "Old reply", op_reply);
+
+               } else if((reply_id - 10000) > msg_id) {
+                       /* wrap-around case */
+                       crm_debug("Recieved old reply: %d (wanted %d)",
+                                 reply_id, msg_id);
+                       crm_log_message_adv(
+                               LOG_MSG, "Old reply", op_reply);
+               } else {
+                       crm_err("Received a __future__ reply:"
+                               " %d (wanted %d)", reply_id, msg_id);
                }
-       }
-
-       if(native->command_channel->ops->get_chan_status(
-                  native->command_channel) != IPC_CONNECT) {
-               crm_err("No reply message - disconnected - %d", rc);
-               cib->state = cib_disconnected;
-               crm_msg_del(op_reply);
-               return cib_not_connected;
-               
-       } else if(rc != IPC_OK) {
-               crm_err("No reply message - failed - %d", rc);
                crm_msg_del(op_reply);
-               return cib_reply_failed;
+               op_reply = NULL;
+       }
 
-       } else if(op_reply == NULL) {
+       if(op_reply == NULL) {
+               if(IPC_ISRCONN(native->command_channel) == FALSE) {
+                       crm_err("No reply message - disconnected - %d",
+                               native->command_channel->ch_status);
+                       cib->state = cib_disconnected;
+                       return cib_not_connected;
+               }
                crm_err("No reply message - empty - %d", rc);
                return cib_reply_failed;
        }
        
+       if(IPC_ISRCONN(native->command_channel) == FALSE) {
+               crm_err("CIB disconnected: %d", 
+                       native->command_channel->ch_status);
+               cib->state = cib_disconnected;
+       }
+       
        crm_debug_3("Syncronous reply recieved");
        rc = cib_ok;
        




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

Message: 2
Date: Wed,  8 Feb 2006 15:15:44 -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/crmd


Modified Files:
        control.c 


Log Message:
Prevent a crash seen by alanr hen we tried to send a message after
  disconnecting from Heartbeat.  Clearly we should set this to NULL 
  at that point and the existing code will do the rest.

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/crmd/control.c,v
retrieving revision 1.110
retrieving revision 1.111
diff -u -3 -r1.110 -r1.111
--- control.c   4 Feb 2006 17:13:13 -0000       1.110
+++ control.c   8 Feb 2006 22:15:44 -0000       1.111
@@ -61,6 +61,7 @@
                        set_bit_inplace(fsa_input_register, R_HA_DISCONNECTED);
                        fsa_cluster_conn->llc_ops->signoff(
                                fsa_cluster_conn, FALSE);
+                       fsa_cluster_conn = NULL;
                }
                crm_info("Disconnected from Heartbeat");
        }




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

Message: 3
Date: Wed,  8 Feb 2006 15:17: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/tengine


Modified Files:
        utils.c 


Log Message:


Logging

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/tengine/utils.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -3 -r1.49 -r1.50
--- utils.c     13 Jan 2006 18:34:25 -0000      1.49
+++ utils.c     8 Feb 2006 22:17:47 -0000       1.50
@@ -1,4 +1,4 @@
-/* $Id: utils.c,v 1.49 2006/01/13 18:34:25 andrew Exp $ */
+/* $Id: utils.c,v 1.50 2006/02/08 22:17:47 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -318,12 +318,12 @@
 void
 print_action(const char *prefix, action_t *action, int log_level) 
 {
-       do_crm_log(log_level, __FILE__, __FUNCTION__, "%s[Action %d] %s (%s 
fail)",
+       do_crm_log(log_level, __FILE__, __FUNCTION__, "%s[Action %d] %s%s",
                   prefix, action->id,
                   action->complete?"Completed":
                    action->invoked?"In-flight":
                    action->sent_update?"Update sent":"Pending",
-                  action->can_fail?"can":"cannot");
+                  action->can_fail?" (can fail)":"");
                
        switch(action->type) {
                case action_type_pseudo:




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

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

Reply via email to