Permalink
Browse files

Fix: rhbz#1527072 - Correctly observe colocation constraints with bun…

…dles in the Master role
  • Loading branch information...
beekhof committed Jan 22, 2018
1 parent dc404dc commit 373c05708302e8daf82aec23afb4e5221beb31f9
Showing with 11 additions and 3 deletions.
  1. +11 −3 pengine/container.c
View
@@ -486,10 +486,18 @@ container_rsc_colocation_rh(resource_t * rsc_lh, resource_t * rsc, rsc_colocatio
} else {
node_t *chosen = tuple->docker->fns->location(tuple->docker, NULL, FALSE);
- if (chosen != NULL && is_set_recursive(tuple->docker, pe_rsc_block, TRUE) == FALSE) {
- pe_rsc_trace(rsc, "Allowing %s: %s %d", constraint->id, chosen->details->uname, chosen->weight);
- allocated_rhs = g_list_prepend(allocated_rhs, chosen);
+ if (chosen == NULL || is_set_recursive(tuple->docker, pe_rsc_block, TRUE)) {
+ continue;
+ }
+ if(constraint->role_rh >= RSC_ROLE_MASTER && tuple->child == NULL) {
+ continue;
}
+ if(constraint->role_rh >= RSC_ROLE_MASTER && tuple->child->next_role < RSC_ROLE_MASTER) {
+ continue;
+ }
+
+ pe_rsc_trace(rsc, "Allowing %s: %s %d", constraint->id, chosen->details->uname, chosen->weight);
+ allocated_rhs = g_list_prepend(allocated_rhs, chosen);
}
}

0 comments on commit 373c057

Please sign in to comment.