18 #define VARIANT_GROUP 1
28 group_variant_data_t *group_data = NULL;
30 get_group_variant_data(group_data, rsc);
36 pe_rsc_debug(rsc,
"Dependency loop detected involving %s", rsc->
id);
40 if (group_data->first_child == NULL) {
47 rsc->
role = group_data->first_child->role;
49 group_data->first_child->rsc_cons =
50 g_list_concat(group_data->first_child->rsc_cons, rsc->
rsc_cons);
53 group_data->last_child->rsc_cons_lhs =
54 g_list_concat(group_data->last_child->rsc_cons_lhs, rsc->
rsc_cons_lhs);
61 for (; gIter != NULL; gIter = gIter->next) {
65 rsc->
id, child_rsc->
id);
66 node = child_rsc->
cmds->
allocate(child_rsc, prefer, data_set);
67 if (group_node == NULL) {
73 "first group member");
76 if (group_data->colocated) {
88 const char *value = NULL;
93 for (; gIter != NULL; gIter = gIter->next) {
134 group_variant_data_t *group_data = NULL;
136 get_group_variant_data(group_data, parent);
138 if (group_data->ordered == FALSE) {
143 if (group_data->child_stopping && group_data->child_starting) {
147 for (; gIter != NULL; gIter = gIter->next) {
156 group_data->child_stopping = TRUE;
161 group_data->child_starting = TRUE;
174 group_variant_data_t *group_data = NULL;
176 get_group_variant_data(group_data, rsc);
182 for (; gIter != NULL; gIter = gIter->next) {
192 if (last_rsc == NULL) {
193 if (group_data->ordered) {
198 }
else if (group_data->colocated) {
200 child_rsc, last_rsc, NULL, NULL,
225 if (group_data->ordered == FALSE) {
232 }
else if (last_rsc != NULL) {
264 if (group_data->ordered
269 last_active = child_rsc;
272 last_rsc = child_rsc;
275 if (group_data->ordered && last_rsc != NULL) {
295 group_variant_data_t *group_data = NULL;
297 if (rsc_lh == NULL) {
298 pe_err(
"rsc_lh was NULL for %s", constraint->
id);
301 }
else if (rsc_rh == NULL) {
302 pe_err(
"rsc_rh was NULL for %s", constraint->
id);
307 pe_rsc_trace(rsc_lh,
"Processing constraints from %s", rsc_lh->
id);
309 get_group_variant_data(group_data, rsc_lh);
311 if (group_data->colocated) {
312 group_data->first_child->cmds->rsc_colocation_lh(group_data->first_child,
319 "between non-colocated group and %s",
320 rsc_lh->
id, rsc_rh->
id);
324 for (; gIter != NULL; gIter = gIter->next) {
338 group_variant_data_t *group_data = NULL;
340 get_group_variant_data(group_data, rsc_rh);
343 pe_rsc_trace(rsc_rh,
"Processing RH %s of constraint %s (LH is %s)",
344 rsc_rh->
id, constraint->
id, rsc_lh->
id);
349 }
else if (group_data->colocated && group_data->first_child) {
352 group_data->last_child->cmds->rsc_colocation_rh(rsc_lh,
353 group_data->last_child,
358 group_data->first_child->cmds->rsc_colocation_rh(rsc_lh,
359 group_data->first_child,
368 " non-colocated group %s", rsc_lh->
id, rsc_rh->
id);
372 for (; gIter != NULL; gIter = gIter->next) {
386 for (gIter = action->
rsc->
children; gIter != NULL; gIter = gIter->next) {
415 pe_rsc_trace(action->
rsc,
"%s is not runnable because of %s (not found in %s)",
416 action->
uuid, task_s, child->
id);
437 for (; gIter != NULL; gIter = gIter->next) {
457 gboolean reset_scores = TRUE;
458 group_variant_data_t *group_data = NULL;
460 get_group_variant_data(group_data, rsc);
462 pe_rsc_debug(rsc,
"Processing rsc_location %s for %s", constraint->
id, rsc->
id);
466 for (; gIter != NULL; gIter = gIter->next) {
470 if (group_data->colocated && reset_scores) {
471 reset_scores = FALSE;
477 g_list_free_full(zero, free);
488 for (GList *gIter = rsc->
children; gIter != NULL; gIter = gIter->next) {
497 GHashTable *nodes,
const char *attr,
float factor,
501 group_variant_data_t *group_data = NULL;
503 get_group_variant_data(group_data, rsc);
506 pe_rsc_info(rsc,
"Breaking dependency loop with %s at %s", rsc->
id, rhs);
513 group_data->first_child->cmds->merge_weights(group_data->first_child, rhs, nodes, attr,
516 for (; gIter != NULL; gIter = gIter->next) {
GList * pcmk__copy_node_list(const GList *list, bool reset)
#define CRM_CHECK(expr, failure_action)
void group_append_meta(pe_resource_t *rsc, xmlNode *xml)
const char * task2text(enum action_tasks task)
#define pe_rsc_debug(rsc, fmt, args...)
#define pe__set_action_flags(action, flags_to_set)
#define pe__show_node_weights(level, rsc, text, nodes, data_set)
#define stop_action(rsc, node, optional)
resource_alloc_functions_t * cmds
void pcmk__new_colocation(const char *id, const char *node_attr, int score, pe_resource_t *rsc_lh, pe_resource_t *rsc_rh, const char *state_lh, const char *state_rh, bool influence, pe_working_set_t *data_set)
enum pe_action_flags(* action_flags)(pe_action_t *, pe_node_t *)
enum rsc_role_e next_role
#define pcmk__config_err(fmt...)
enum pe_graph_flags(* update_actions)(pe_action_t *, pe_action_t *, pe_node_t *, enum pe_action_flags, enum pe_action_flags, enum pe_ordering, pe_working_set_t *data_set)
void group_rsc_location(pe_resource_t *rsc, pe__location_t *constraint)
enum pe_graph_flags native_update_actions(pe_action_t *first, pe_action_t *then, pe_node_t *node, enum pe_action_flags flags, enum pe_action_flags filter, enum pe_ordering type, pe_working_set_t *data_set)
void native_expand(pe_resource_t *rsc, pe_working_set_t *data_set)
enum crm_ais_msg_types type
void native_rsc_location(pe_resource_t *rsc, pe__location_t *constraint)
GHashTable * pcmk__native_merge_weights(pe_resource_t *rsc, const char *rhs, GHashTable *nodes, const char *attr, float factor, uint32_t flags)
#define pe__set_resource_flags(resource, flags_to_set)
void group_update_pseudo_status(pe_resource_t *parent, pe_resource_t *child)
#define pe_rsc_provisional
#define XML_RSC_ATTR_PROMOTABLE
void group_rsc_colocation_rh(pe_resource_t *lh_rsc, pe_resource_t *rh_rsc, pcmk__colocation_t *constraint, pe_working_set_t *data_set)
void(* create_actions)(pe_resource_t *, pe_working_set_t *)
#define order_stop_stop(rsc1, rsc2, type)
pe_resource_t * uber_parent(pe_resource_t *rsc)
enum pe_graph_flags group_update_actions(pe_action_t *first, pe_action_t *then, pe_node_t *node, enum pe_action_flags flags, enum pe_action_flags filter, enum pe_ordering type, pe_working_set_t *data_set)
#define pe__clear_action_flags(action, flags_to_clear)
enum action_tasks get_complex_task(pe_resource_t *rsc, const char *name, gboolean allow_non_atomic)
#define pcmk_is_set(g, f)
Convenience alias for pcmk_all_flags_set(), to check single flag.
#define pe_rsc_promotable
GHashTable * pcmk__group_merge_weights(pe_resource_t *rsc, const char *rhs, GHashTable *nodes, const char *attr, float factor, uint32_t flags)
void(* expand)(pe_resource_t *, pe_working_set_t *)
enum pe_restart restart_type
#define pe_rsc_allocating
void group_internal_constraints(pe_resource_t *rsc, pe_working_set_t *data_set)
enum pe_obj_types variant
int new_rsc_order(pe_resource_t *lh_rsc, const char *lh_task, pe_resource_t *rh_rsc, const char *rh_task, enum pe_ordering type, pe_working_set_t *data_set)
void(* rsc_location)(pe_resource_t *, pe__location_t *)
void(* rsc_colocation_rh)(pe_resource_t *, pe_resource_t *, pcmk__colocation_t *, pe_working_set_t *)
void group_create_actions(pe_resource_t *rsc, pe_working_set_t *data_set)
enum pe_action_flags group_action_flags(pe_action_t *action, pe_node_t *node)
#define promoted_key(rsc)
#define start_action(rsc, node, optional)
void pe__set_next_role(pe_resource_t *rsc, enum rsc_role_e role, const char *why)
void(* internal_constraints)(pe_resource_t *, pe_working_set_t *)
#define pe__clear_resource_flags(resource, flags_to_clear)
enum pe_action_flags flags
#define order_start_start(rsc1, rsc2, type)
const char * node_attribute
gboolean crm_is_true(const char *s)
#define pe_rsc_trace(rsc, fmt, args...)
#define pe__set_order_flags(order_flags, flags_to_set)
#define pe_flag_show_scores
#define pe__clear_raw_action_flags(action_flags, action_name, flags_to_clear)
void group_expand(pe_resource_t *rsc, pe_working_set_t *data_set)
pe_action_t * find_first_action(GList *input, const char *uuid, const char *task, pe_node_t *on_node)
void(* rsc_colocation_lh)(pe_resource_t *, pe_resource_t *, pcmk__colocation_t *, pe_working_set_t *)
void group_rsc_colocation_lh(pe_resource_t *lh_rsc, pe_resource_t *rh_rsc, pcmk__colocation_t *constraint, pe_working_set_t *data_set)
#define pe_rsc_info(rsc, fmt, args...)
pe_action_t * custom_action(pe_resource_t *rsc, char *key, const char *task, pe_node_t *on_node, gboolean optional, gboolean foo, pe_working_set_t *data_set)
GHashTable * allowed_nodes
pe_node_t *(* allocate)(pe_resource_t *, pe_node_t *, pe_working_set_t *)
pe_node_t * pcmk__group_allocate(pe_resource_t *rsc, pe_node_t *preferred, pe_working_set_t *data_set)