Skip to content

Commit

Permalink
PE: Allow the graph to assume container nodes will come up and schedu…
Browse files Browse the repository at this point in the history
…le actions for it
  • Loading branch information
beekhof committed Feb 24, 2017
1 parent aec6535 commit 7d6cdb8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 9 deletions.
3 changes: 2 additions & 1 deletion lib/pengine/utils.c
Expand Up @@ -509,7 +509,8 @@ custom_action(resource_t * rsc, char *key, const char *task,
pe_set_action_bit(action, pe_action_optional);
/* action->runnable = FALSE; */

} else if (action->node->details->online == FALSE) {
} else if (action->node->details->online == FALSE
&& !is_container_remote_node(action->node)) {
pe_clear_action_bit(action, pe_action_runnable);
do_crm_log(warn_level, "Action %s on %s is unrunnable (offline)",
action->uuid, action->node->details->uname);
Expand Down
3 changes: 2 additions & 1 deletion pengine/graph.c
Expand Up @@ -1164,7 +1164,8 @@ should_dump_action(action_t * action)
log_action(LOG_DEBUG, "Unallocated action", action, FALSE);
return FALSE;

} else if (action->node->details->online == FALSE) {
} else if (action->node->details->online == FALSE
&& !is_container_remote_node(action->node)) {
pe_err("action %d was (%s) scheduled for offline node", action->id, action->uuid);
log_action(LOG_DEBUG, "Action for offline node", action, FALSE);
return FALSE;
Expand Down
25 changes: 18 additions & 7 deletions pengine/utils.c
Expand Up @@ -242,13 +242,24 @@ native_assign_node(resource_t * rsc, GListPtr nodes, node_t * chosen, gboolean f
{
CRM_ASSERT(rsc->variant == pe_native);

if (force == FALSE
&& chosen != NULL && (can_run_resources(chosen) == FALSE || chosen->weight < 0)) {
crm_debug("All nodes for resource %s are unavailable"
", unclean or shutting down (%s: %d, %d)",
rsc->id, chosen->details->uname, can_run_resources(chosen), chosen->weight);
rsc->next_role = RSC_ROLE_STOPPED;
chosen = NULL;
if (force == FALSE && chosen != NULL) {
bool unset = FALSE;

if(chosen->weight < 0) {
unset = TRUE;

// Allow the graph to assume that the remote resource will come up
} else if(can_run_resources(chosen) == FALSE && !is_container_remote_node(chosen)) {
unset = TRUE;
}

if(unset) {
crm_debug("All nodes for resource %s are unavailable"
", unclean or shutting down (%s: %d, %d)",
rsc->id, chosen->details->uname, can_run_resources(chosen), chosen->weight);
rsc->next_role = RSC_ROLE_STOPPED;
chosen = NULL;
}
}

/* todo: update the old node for each resource to reflect its
Expand Down

0 comments on commit 7d6cdb8

Please sign in to comment.