|
|
ed0026 |
commit 66a3ea6bf9024960736455022c8827a2fbb03bc6
|
|
|
ed0026 |
Author: Andrew Beekhof <andrew@beekhof.net>
|
|
|
ed0026 |
Date: Fri Aug 2 13:10:58 2013 +1000
|
|
|
ed0026 |
|
|
|
ed0026 |
Fix: PE: Do not allow colocation with blocked clone instances
|
|
|
ed0026 |
|
|
|
ed0026 |
diff --git a/include/crm/pengine/internal.h b/include/crm/pengine/internal.h
|
|
|
ed0026 |
index 20bb687..a6b9369 100644
|
|
|
ed0026 |
--- a/include/crm/pengine/internal.h
|
|
|
ed0026 |
+++ b/include/crm/pengine/internal.h
|
|
|
ed0026 |
@@ -234,6 +234,7 @@ char *clone_strip(const char *last_rsc_id);
|
|
|
ed0026 |
char *clone_zero(const char *last_rsc_id);
|
|
|
ed0026 |
|
|
|
ed0026 |
gint sort_node_uname(gconstpointer a, gconstpointer b);
|
|
|
ed0026 |
+bool is_set_recursive(resource_t * rsc, long long flag, bool any);
|
|
|
ed0026 |
|
|
|
ed0026 |
enum rsc_digest_cmp_val {
|
|
|
ed0026 |
/*! Digests are the same */
|
|
|
ed0026 |
diff --git a/lib/pengine/clone.c b/lib/pengine/clone.c
|
|
|
ed0026 |
index 7bccd65..c6c69e6 100644
|
|
|
ed0026 |
--- a/lib/pengine/clone.c
|
|
|
ed0026 |
+++ b/lib/pengine/clone.c
|
|
|
ed0026 |
@@ -349,7 +349,7 @@ clone_print_xml(resource_t * rsc, const char *pre_text, long options, void *prin
|
|
|
ed0026 |
free(child_text);
|
|
|
ed0026 |
}
|
|
|
ed0026 |
|
|
|
ed0026 |
-static bool is_set_recursive(resource_t * rsc, long long flag, bool any)
|
|
|
ed0026 |
+bool is_set_recursive(resource_t * rsc, long long flag, bool any)
|
|
|
ed0026 |
{
|
|
|
ed0026 |
GListPtr gIter;
|
|
|
ed0026 |
bool all = !any;
|
|
|
ed0026 |
diff --git a/pengine/clone.c b/pengine/clone.c
|
|
|
ed0026 |
index 8f340f4..b15f76f 100644
|
|
|
ed0026 |
--- a/pengine/clone.c
|
|
|
ed0026 |
+++ b/pengine/clone.c
|
|
|
ed0026 |
@@ -925,7 +925,10 @@ find_compatible_child_by_node(resource_t * local_child, node_t * local_node, res
|
|
|
ed0026 |
resource_t *child_rsc = (resource_t *) gIter->data;
|
|
|
ed0026 |
enum rsc_role_e next_role = child_rsc->fns->state(child_rsc, current);
|
|
|
ed0026 |
|
|
|
ed0026 |
- node = child_rsc->fns->location(child_rsc, NULL, current);
|
|
|
ed0026 |
+ if (is_set_recursive(child_rsc, pe_rsc_block, TRUE) == FALSE) {
|
|
|
ed0026 |
+ /* We only want instances that haven't failed */
|
|
|
ed0026 |
+ node = child_rsc->fns->location(child_rsc, NULL, current);
|
|
|
ed0026 |
+ }
|
|
|
ed0026 |
|
|
|
ed0026 |
if (filter != RSC_ROLE_UNKNOWN && next_role != filter) {
|
|
|
ed0026 |
crm_trace("Filtered %s", child_rsc->id);
|
|
|
ed0026 |
@@ -1069,7 +1072,7 @@ clone_rsc_colocation_rh(resource_t * rsc_lh, resource_t * rsc_rh, rsc_colocation
|
|
|
ed0026 |
resource_t *child_rsc = (resource_t *) gIter->data;
|
|
|
ed0026 |
node_t *chosen = child_rsc->fns->location(child_rsc, NULL, FALSE);
|
|
|
ed0026 |
|
|
|
ed0026 |
- if (chosen != NULL) {
|
|
|
ed0026 |
+ if (chosen != NULL && is_set_recursive(child_rsc, pe_rsc_block, TRUE) == FALSE) {
|
|
|
ed0026 |
rhs = g_list_prepend(rhs, chosen);
|
|
|
ed0026 |
}
|
|
|
ed0026 |
}
|