|
|
ed0026 |
commit 7d47ad8be7a9c31a1eba2a3714a645ae3985fc37
|
|
|
ed0026 |
Author: Andrew Beekhof <andrew@beekhof.net>
|
|
|
ed0026 |
Date: Fri Aug 9 15:00:40 2013 +1000
|
|
|
ed0026 |
|
|
|
ed0026 |
Bug cl#5171 - PE: Don't prevent clones from running due to dependant resources
|
|
|
ed0026 |
|
|
|
ed0026 |
(cherry picked from commit 1c057f8808c71763134ae829851d2a2b3b604d07)
|
|
|
ed0026 |
|
|
|
ed0026 |
diff --git a/include/crm/pengine/internal.h b/include/crm/pengine/internal.h
|
|
|
ed0026 |
index a6b9369..7240106 100644
|
|
|
ed0026 |
--- a/include/crm/pengine/internal.h
|
|
|
ed0026 |
+++ b/include/crm/pengine/internal.h
|
|
|
ed0026 |
@@ -129,6 +129,7 @@ pe_hash_table_lookup(GHashTable * hash, gconstpointer key)
|
|
|
ed0026 |
extern action_t *get_pseudo_op(const char *name, pe_working_set_t * data_set);
|
|
|
ed0026 |
extern gboolean order_actions(action_t * lh_action, action_t * rh_action, enum pe_ordering order);
|
|
|
ed0026 |
|
|
|
ed0026 |
+GHashTable *node_hash_dup(GHashTable * hash);
|
|
|
ed0026 |
extern GListPtr node_list_and(GListPtr list1, GListPtr list2, gboolean filter);
|
|
|
ed0026 |
|
|
|
ed0026 |
extern GListPtr node_list_xor(GListPtr list1, GListPtr list2, gboolean filter);
|
|
|
ed0026 |
diff --git a/pengine/clone.c b/pengine/clone.c
|
|
|
ed0026 |
index b15f76f..9113e9d 100644
|
|
|
ed0026 |
--- a/pengine/clone.c
|
|
|
ed0026 |
+++ b/pengine/clone.c
|
|
|
ed0026 |
@@ -385,8 +385,9 @@ color_instance(resource_t * rsc, node_t * prefer, gboolean all_coloc, pe_working
|
|
|
ed0026 |
{
|
|
|
ed0026 |
node_t *chosen = NULL;
|
|
|
ed0026 |
node_t *local_node = NULL;
|
|
|
ed0026 |
+ GHashTable *backup = NULL;
|
|
|
ed0026 |
|
|
|
ed0026 |
- pe_rsc_trace(rsc, "Processing %s", rsc->id);
|
|
|
ed0026 |
+ pe_rsc_trace(rsc, "Processing %s %d", rsc->id, all_coloc);
|
|
|
ed0026 |
|
|
|
ed0026 |
if (is_not_set(rsc->flags, pe_rsc_provisional)) {
|
|
|
ed0026 |
return rsc->fns->location(rsc, NULL, FALSE);
|
|
|
ed0026 |
@@ -421,15 +422,19 @@ color_instance(resource_t * rsc, node_t * prefer, gboolean all_coloc, pe_working
|
|
|
ed0026 |
}
|
|
|
ed0026 |
}
|
|
|
ed0026 |
|
|
|
ed0026 |
+ backup = node_hash_dup(rsc->allowed_nodes);
|
|
|
ed0026 |
chosen = rsc->cmds->allocate(rsc, prefer, data_set);
|
|
|
ed0026 |
if (chosen) {
|
|
|
ed0026 |
local_node = pe_hash_table_lookup(rsc->parent->allowed_nodes, chosen->details->id);
|
|
|
ed0026 |
|
|
|
ed0026 |
if (prefer && chosen && chosen->details != prefer->details) {
|
|
|
ed0026 |
- crm_err("Pre-allocation failed: got %s instead of %s",
|
|
|
ed0026 |
- chosen->details->uname, prefer->details->uname);
|
|
|
ed0026 |
+ crm_notice("Pre-allocation failed: got %s instead of %s",
|
|
|
ed0026 |
+ chosen->details->uname, prefer->details->uname);
|
|
|
ed0026 |
+ g_hash_table_destroy(rsc->allowed_nodes);
|
|
|
ed0026 |
+ rsc->allowed_nodes = backup;
|
|
|
ed0026 |
native_deallocate(rsc);
|
|
|
ed0026 |
chosen = NULL;
|
|
|
ed0026 |
+ backup = NULL;
|
|
|
ed0026 |
|
|
|
ed0026 |
} else if (local_node) {
|
|
|
ed0026 |
local_node->count++;
|
|
|
ed0026 |
@@ -442,6 +447,9 @@ color_instance(resource_t * rsc, node_t * prefer, gboolean all_coloc, pe_working
|
|
|
ed0026 |
}
|
|
|
ed0026 |
}
|
|
|
ed0026 |
|
|
|
ed0026 |
+ if(backup) {
|
|
|
ed0026 |
+ g_hash_table_destroy(backup);
|
|
|
ed0026 |
+ }
|
|
|
ed0026 |
return chosen;
|
|
|
ed0026 |
}
|
|
|
ed0026 |
|
|
|
ed0026 |
@@ -587,7 +595,7 @@ clone_color(resource_t * rsc, node_t * prefer, pe_working_set_t * data_set)
|
|
|
ed0026 |
}
|
|
|
ed0026 |
}
|
|
|
ed0026 |
|
|
|
ed0026 |
- pe_rsc_trace(rsc, "Done pre-allocating");
|
|
|
ed0026 |
+ pe_rsc_trace(rsc, "Done pre-allocating (%d of %d)", allocated, clone_data->clone_max);
|
|
|
ed0026 |
g_list_free(nodes);
|
|
|
ed0026 |
|
|
|
ed0026 |
for (gIter = rsc->children; gIter != NULL; gIter = gIter->next) {
|
|
|
ed0026 |
diff --git a/pengine/native.c b/pengine/native.c
|
|
|
ed0026 |
index 21ad629..4016a3c 100644
|
|
|
ed0026 |
--- a/pengine/native.c
|
|
|
ed0026 |
+++ b/pengine/native.c
|
|
|
ed0026 |
@@ -313,7 +313,7 @@ node_hash_update(GHashTable * list1, GHashTable * list2, const char *attr, float
|
|
|
ed0026 |
}
|
|
|
ed0026 |
}
|
|
|
ed0026 |
|
|
|
ed0026 |
-static GHashTable *
|
|
|
ed0026 |
+GHashTable *
|
|
|
ed0026 |
node_hash_dup(GHashTable * hash)
|
|
|
ed0026 |
{
|
|
|
ed0026 |
/* Hack! */
|