Hi, Yan

I wrote a patch for Pacemaker-dev to solve this problem.

I want you to confirm the patch.

I want a repository to merge it if there is not a problem.

Best Regards,
Yuusuke

(2011/06/20 16:10), Yuusuke IIDA wrote:
> Hi, Yan
> 
> I wanted to scatter transition of the group resource, however failed.
> 
>   * Initial state
> Online: [act1 sby1 sby2]
> Full list of resources:
>   Resource Group: grp1
>       rsc1       (ocf::pacemaker:Dummy): Started act1
>   Resource Group: grp2
>       rsc2       (ocf::pacemaker:Dummy): Started act1
>   Resource Group: grp3
>       rsc3       (ocf::pacemaker:Dummy): Started act1
> 
>   * When I let you break down in order of grp1 ->  grp2 ->  grp3.
> Online: [act1 sby1 sby2]
> Full list of resources:
>   Resource Group: grp1
>       rsc1       (ocf::pacemaker:Dummy): Started sby1
>   Resource Group: grp2
>       rsc2       (ocf::pacemaker:Dummy): Started sby2
>   Resource Group: grp3
>       rsc3       (ocf::pacemaker:Dummy): Started sby1
> 
>   * When I let you break down in order of grp3 ->  grp2 ->  grp1. (there is a 
> problem)
> Online: [act1 sby1 sby2]
> Full list of resources:
>   Resource Group: grp1
>       rsc1       (ocf::pacemaker:Dummy): Started sby1
>   Resource Group: grp2
>       rsc2       (ocf::pacemaker:Dummy): Started sby1
>   Resource Group: grp3
>       rsc3       (ocf::pacemaker:Dummy): Started sby1
> 
> As for this, will not it be right like primitive resource to be dispersed
> transition?
> 
> I attach hb_report when a problem happened.
> 
> Best Regards,
> Yuusuke
> 
> 
> 
> _______________________________________________
> Pacemaker mailing list: Pacemaker@oss.clusterlabs.org
> http://oss.clusterlabs.org/mailman/listinfo/pacemaker
> 
> Project Home: http://www.clusterlabs.org
> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
> Bugs: 
> http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker

-- 
----------------------------------------
METRO SYSTEMS CO., LTD

Yuusuke Iida
Mail: iiday...@intellilink.co.jp
----------------------------------------
diff -r 75575ce39861 pengine/allocate.c
--- a/pengine/allocate.c	Tue Jun 21 15:54:20 2011 +0200
+++ b/pengine/allocate.c	Thu Jun 30 17:20:00 2011 +0900
@@ -918,7 +918,7 @@
 static gint
 sort_rsc_process_order(gconstpointer a, gconstpointer b, gpointer data)
 {
-    int level = LOG_DEBUG_3;
+    int level = LOG_DEBUG;
     const resource_t *resource1 = (const resource_t*)a;
     const resource_t *resource2 = (const resource_t*)b;
     const GListPtr nodes = (GListPtr)data;
@@ -958,11 +958,45 @@
 	resource1_node = g_hash_table_lookup(resource1->allowed_nodes, node->details->id);
 	if (resource1_node) {
 	    resource1_weight = resource1_node->weight;
+	    if(resource1->variant == pe_group) {
+		GListPtr gIter = resource1->children;
+		for(; gIter != NULL; gIter = gIter->next) {
+		    resource_t *child_rsc = (resource_t*)gIter->data;
+		    node_t *running_node = g_list_nth_data(child_rsc->running_on, 0);
+		    if(running_node) {
+		        node_t *tmpnode = g_hash_table_lookup(child_rsc->allowed_nodes,
+						running_node->details->id);
+			if(tmpnode->weight == -INFINITY) {
+			    resource1_weight = -INFINITY;
+			    break;
+			} else if(tmpnode->weight > resource1_weight) {
+			    resource1_weight = tmpnode->weight;
+			}
+		    }
+		}
+	    }
 	}
 
 	resource2_node = g_hash_table_lookup(resource2->allowed_nodes, node->details->id);
 	if (resource2_node) {
 	    resource2_weight = resource2_node->weight;
+	    if(resource2->variant == pe_group) {
+		GListPtr gIter = resource2->children;
+		for(; gIter != NULL; gIter = gIter->next) {
+		    resource_t *child_rsc = (resource_t*)gIter->data;
+		    node_t *running_node = g_list_nth_data(child_rsc->running_on, 0);
+		    if(running_node) {
+		        node_t *tmpnode = g_hash_table_lookup(child_rsc->allowed_nodes,
+						running_node->details->id);
+			if(tmpnode->weight == -INFINITY) {
+			    resource2_weight = -INFINITY;
+			    break;
+			} else if(tmpnode->weight > resource2_weight) {
+			    resource2_weight = tmpnode->weight;
+			}
+		    }
+		}
+	    }
 	}
 
 	if(resource1_weight > resource2_weight) {
_______________________________________________
Pacemaker mailing list: Pacemaker@oss.clusterlabs.org
http://oss.clusterlabs.org/mailman/listinfo/pacemaker

Project Home: http://www.clusterlabs.org
Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
Bugs: http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker

Reply via email to