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


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

Message: 1
Date: Tue, 13 Jun 2006 03:57:38 -0600 (MDT)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: mgmt by zhenh from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

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

Dir     : linux-ha/mgmt/client


Modified Files:
        haclient.py.in 


Log Message:
keep trying to reconnect to cluster even all nodes down
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/mgmt/client/haclient.py.in,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -3 -r1.55 -r1.56
--- haclient.py.in      12 Jun 2006 10:37:23 -0000      1.55
+++ haclient.py.in      13 Jun 2006 09:57:38 -0000      1.56
@@ -1672,6 +1672,7 @@
        io_tag = None
        update_timer = -1
        active_nodes = []
+       all_nodes = []
        failed_reason = ""
                
        # cache functions
@@ -1734,13 +1735,14 @@
                                "\n or the user doesn't belong to haclient 
group")
                        mgmt_disconnect()
                        return False
+               window.statusbar.pop(1) 
                window.statusbar.push(1,_("Connected to ")+server)
                self.connected = True
                self.username = username
                self.password = password
 
                window.statusbar.push(2,_("Updating data from server..."))
-               self.update_timer = gobject.timeout_add(100, self.update)
+               self.update_timer = gobject.timeout_add(200, self.update)
                
                self.do_cmd("regevt\nevt:cib_changed")
                self.do_cmd("regevt\nevt:disconnected")
@@ -1784,6 +1786,16 @@
                window.statusbar.pop(1)
                
        # event handler 
+       def on_reconnect(self) :
+               if self.all_nodes == [] :
+                       window.statusbar.pop(1)
+                       return False
+               for server in self.all_nodes :
+                       if self.login(server, self.username, self.password) :
+                               return False
+               return True
+               
+               
        def on_event(self, source, condition) :
                event =  mgmt_recvmsg()
                log("on_event:"+str(event))
@@ -1792,7 +1804,7 @@
                                gobject.source_remove(self.update_timer)
                        else :
                                window.statusbar.push(2,"Updating data from 
server...")
-                       self.update_timer = gobject.timeout_add(100, 
self.update)
+                       self.update_timer = gobject.timeout_add(200, 
self.update)
                        return True
                elif event == None or event == "evt:disconnected" :
                        self.logout()
@@ -1800,7 +1812,8 @@
                                if self.login(server, self.username, 
self.password) :
                                        break
                        else :
-                               msgbox(_("can't connect to any node"))
+                               window.statusbar.push(1,_("Reconnecting..."))
+                               gobject.timeout_add(1000, self.on_reconnect)
 
                return True
 
@@ -1847,7 +1860,8 @@
                return self.query("dc")
 
        def get_all_nodes(self) :
-               return self.query("all_nodes")
+               self.all_nodes = self.query("all_nodes")
+               return self.all_nodes
 
        def get_active_nodes(self):
                self.active_nodes = self.query("active_nodes")




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

Message: 2
Date: Tue, 13 Jun 2006 04:30:51 -0600 (MDT)
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/pengine


Modified Files:
        utils.c 


Log Message:
If no data_set is provided, just update what the resource already has.

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/lib/crm/pengine/utils.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- utils.c     8 Jun 2006 13:39:10 -0000       1.4
+++ utils.c     13 Jun 2006 10:30:50 -0000      1.5
@@ -1,4 +1,4 @@
-/* $Id: utils.c,v 1.4 2006/06/08 13:39:10 andrew Exp $ */
+/* $Id: utils.c,v 1.5 2006/06/13 10:30:50 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -1147,11 +1147,16 @@
        if(node != NULL) {
                resource_node_score(rsc, node, score, tag);
 
-       } else {
+       } else if(data_set != NULL) {
                slist_iter(
                        node, node_t, data_set->nodes, lpc,
                        resource_node_score(rsc, node, score, tag);
                        );
+       } else {
+               slist_iter(
+                       node, node_t, rsc->allowed_nodes, lpc,
+                       resource_node_score(rsc, node, score, tag);
+                       );
        }
 }
 




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

Message: 3
Date: Tue, 13 Jun 2006 07:08:08 -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/pengine


Modified Files:
        group.c 


Log Message:
Consistently use first_child for group based constraints

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/pengine/group.c,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -3 -r1.65 -r1.66
--- group.c     8 Jun 2006 13:39:10 -0000       1.65
+++ group.c     13 Jun 2006 13:08:07 -0000      1.66
@@ -1,4 +1,4 @@
-/* $Id: group.c,v 1.65 2006/06/08 13:39:10 andrew Exp $ */
+/* $Id: group.c,v 1.66 2006/06/13 13:08:07 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -199,10 +199,10 @@
 
                child_rsc->cmds->internal_constraints(child_rsc, data_set);
 
-               if(group_data->colocated) {
+               if(group_data->colocated && child_rsc != 
group_data->first_child) {
                        rsc_colocation_new(
-                               "pe_group_internal_colo", pecs_must,
-                               group_data->self, child_rsc,
+                               "group:internal_colocation", pecs_must,
+                               group_data->first_child, child_rsc,
                                NULL, NULL);
                }
        
@@ -282,7 +282,6 @@
        crm_debug_4("Processing constraints from %s", rsc_lh->id);
 
        get_group_variant_data(group_data, rsc_lh);
-       CRM_CHECK(group_data->self != NULL, return);
 
        if(group_data->colocated) {
                group_data->first_child->cmds->rsc_colocation_lh(
@@ -308,7 +307,6 @@
 {
        group_variant_data_t *group_data = NULL;
        get_group_variant_data(group_data, rsc_rh);
-       CRM_CHECK(group_data->self != NULL, return);
        CRM_CHECK(rsc_lh->variant == pe_native, return);
 
        crm_debug_3("Processing RH of constraint %s", constraint->id);




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

Message: 4
Date: Tue, 13 Jun 2006 07:09:07 -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/pengine


Modified Files:
        clone.c 


Log Message:
Fix clone interleaving that got broken when colocation constraints got fixed.

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/pengine/clone.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- clone.c     8 Jun 2006 13:39:10 -0000       1.2
+++ clone.c     13 Jun 2006 13:09:06 -0000      1.3
@@ -1,4 +1,4 @@
-/* $Id: clone.c,v 1.2 2006/06/08 13:39:10 andrew Exp $ */
+/* $Id: clone.c,v 1.3 2006/06/13 13:09:06 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -696,6 +696,37 @@
                NULL, last_rsc, data_set);
 }
 
+static resource_t*
+find_compatible_child(resource_t *local_child, resource_t *rsc)
+{
+       node_t *local_node = NULL;
+       node_t *node = NULL;
+       clone_variant_data_t *clone_data = NULL;
+       get_clone_variant_data(clone_data, rsc);
+       CRM_ASSERT(local_child->color != NULL);
+       
+       local_node = local_child->color->details->candidate_nodes->data;
+       if(local_node == NULL) {
+               crm_debug("Can't colocate unrunnable child %s with %s",
+                        local_child->id, rsc->id);
+               return NULL;
+       }
+       
+       slist_iter(
+               child_rsc, resource_t, clone_data->child_list, lpc,
+               CRM_ASSERT(child_rsc->color != NULL);
+               node = child_rsc->color->details->candidate_nodes->data;
+               if(node->details == local_node->details) {
+                       crm_info("Colocating %s with %s on %s",
+                                local_child->id, child_rsc->id, 
node->details->uname);
+                       return child_rsc;
+               }
+               );
+       crm_debug("Can't colocate child %s with %s",
+                local_child->id, rsc->id);
+       return NULL;
+}
+
 void clone_rsc_colocation_lh(
        resource_t *rsc_lh, resource_t *rsc_rh, rsc_colocation_t *constraint)
 {
@@ -747,38 +778,30 @@
        }
        
        if(do_interleave) {
-               resource_t *child_lh = NULL;
-               resource_t *child_rh = NULL;
+               resource_t *rh_child = NULL;
                
-               GListPtr iter_lh = clone_data->child_list;
-               GListPtr iter_rh = clone_data_rh->child_list;
+               slist_iter(lh_child, resource_t, clone_data->child_list, lpc,
 
-               crm_debug_2("Interleaving %s with %s",
-                           constraint->rsc_lh->id, constraint->rsc_rh->id);
-               /* If the resource have different numbers of incarnations,
-                *   then just do as many as are available
-                */
-               while(iter_lh != NULL && iter_rh != NULL) {
-                       child_lh = iter_lh->data;
-                       child_rh = iter_rh->data;
-                       iter_lh = iter_lh->next;
-                       iter_rh = iter_rh->next;
-                       
-                       crm_debug_3("Colocating %s with %s", child_lh->id, 
child_rh->id);
-                       child_lh->cmds->rsc_colocation_lh(child_lh, child_rh, 
constraint);
-               }
+                          CRM_ASSERT(lh_child != NULL);
+                          rh_child = find_compatible_child(lh_child, rsc_rh);
+                          if(rh_child == NULL) {
+                                  continue;
+                          }
+                          lh_child->cmds->rsc_colocation_lh(
+                                  lh_child, rh_child, constraint);
+                       );
                return;
-
        }
        
        slist_iter(
                child_rsc, resource_t, clone_data->child_list, lpc,
                
-               print_resource(LOG_DEBUG_3, "LHS", child_rsc, TRUE);
                child_rsc->cmds->rsc_colocation_lh(child_rsc, 
constraint->rsc_rh, constraint);
                );
 }
 
+
+
 void clone_rsc_colocation_rh(
        resource_t *rsc_lh, resource_t *rsc_rh, rsc_colocation_t *constraint)
 {




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

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


End of Linux-ha-cvs Digest, Vol 31, Issue 42
********************************************

Reply via email to