18 #define VARIANT_GROUP 1 30 group_variant_data_t *group_data = NULL;
32 bool any_unmanaged =
false;
34 get_group_variant_data(group_data, rsc);
37 member = group_data->first_child;
55 for (GList *item = rsc->
children->next; item != NULL; item = item->next) {
58 for (GList *cons_iter = rsc->
rsc_cons; cons_iter != NULL;
59 cons_iter = cons_iter->next) {
75 member = group_data->last_child;
88 group_variant_data_t *group_data = NULL;
90 get_group_variant_data(group_data, rsc);
96 pe_rsc_debug(rsc,
"Dependency loop detected involving %s", rsc->
id);
100 if (group_data->first_child == NULL) {
107 rsc->
role = group_data->first_child->role;
109 expand_group_colocations(rsc);
115 for (; gIter != NULL; gIter = gIter->next) {
119 rsc->
id, child_rsc->
id);
120 node = child_rsc->
cmds->
allocate(child_rsc, prefer, data_set);
121 if (group_node == NULL) {
127 "first group member");
130 if (group_data->colocated) {
142 const char *value = NULL;
147 for (; gIter != NULL; gIter = gIter->next) {
188 group_variant_data_t *group_data = NULL;
190 get_group_variant_data(group_data, parent);
192 if (group_data->ordered == FALSE) {
197 if (group_data->child_stopping && group_data->child_starting) {
201 for (; gIter != NULL; gIter = gIter->next) {
210 group_data->child_stopping = TRUE;
215 group_data->child_starting = TRUE;
228 group_variant_data_t *group_data = NULL;
230 get_group_variant_data(group_data, rsc);
236 for (; gIter != NULL; gIter = gIter->next) {
246 if (last_rsc == NULL) {
247 if (group_data->ordered) {
252 }
else if (group_data->colocated) {
254 child_rsc, last_rsc, NULL, NULL,
279 if (group_data->ordered == FALSE) {
286 }
else if (last_rsc != NULL) {
308 if (group_data->ordered
313 last_active = child_rsc;
316 last_rsc = child_rsc;
319 if (group_data->ordered && last_rsc != NULL) {
339 group_variant_data_t *group_data = NULL;
341 if (rsc_lh == NULL) {
342 pe_err(
"rsc_lh was NULL for %s", constraint->
id);
345 }
else if (rsc_rh == NULL) {
346 pe_err(
"rsc_rh was NULL for %s", constraint->
id);
351 pe_rsc_trace(rsc_lh,
"Processing constraints from %s", rsc_lh->
id);
353 get_group_variant_data(group_data, rsc_lh);
355 if (group_data->colocated) {
356 group_data->first_child->cmds->rsc_colocation_lh(group_data->first_child,
363 "between non-colocated group and %s",
364 rsc_lh->
id, rsc_rh->
id);
368 for (; gIter != NULL; gIter = gIter->next) {
382 group_variant_data_t *group_data = NULL;
384 get_group_variant_data(group_data, rsc_rh);
387 pe_rsc_trace(rsc_rh,
"Processing RH %s of constraint %s (LH is %s)",
388 rsc_rh->
id, constraint->
id, rsc_lh->
id);
393 }
else if (group_data->colocated && group_data->first_child) {
396 group_data->last_child->cmds->rsc_colocation_rh(rsc_lh,
397 group_data->last_child,
402 group_data->first_child->cmds->rsc_colocation_rh(rsc_lh,
403 group_data->first_child,
412 " non-colocated group %s", rsc_lh->
id, rsc_rh->
id);
416 for (; gIter != NULL; gIter = gIter->next) {
430 for (gIter =
action->rsc->children; gIter != NULL; gIter = gIter->next) {
481 for (; gIter != NULL; gIter = gIter->next) {
501 gboolean reset_scores = TRUE;
502 group_variant_data_t *group_data = NULL;
504 get_group_variant_data(group_data, rsc);
506 pe_rsc_debug(rsc,
"Processing rsc_location %s for %s", constraint->
id, rsc->
id);
510 for (; gIter != NULL; gIter = gIter->next) {
514 if (group_data->colocated && reset_scores) {
515 reset_scores = FALSE;
521 g_list_free_full(zero, free);
532 for (GList *gIter = rsc->
children; gIter != NULL; gIter = gIter->next) {
541 GHashTable *nodes,
const char *attr,
float factor,
545 group_variant_data_t *group_data = NULL;
547 get_group_variant_data(group_data, rsc);
550 pe_rsc_info(rsc,
"Breaking dependency loop with %s at %s", rsc->
id, rhs);
557 group_data->first_child->cmds->merge_weights(group_data->first_child, rhs, nodes, attr,
560 for (; gIter != NULL; gIter = gIter->next) {
GList * pcmk__copy_node_list(const GList *list, bool reset)
#define CRM_CHECK(expr, failure_action)
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)
GHashTable * pcmk__group_merge_weights(pe_resource_t *rsc, const char *rhs, GHashTable *nodes, const char *attr, float factor, uint32_t flags)
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_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)
enum rsc_role_e next_role
#define pcmk__config_err(fmt...)
void group_rsc_colocation_lh(pe_resource_t *rsc_lh, pe_resource_t *rsc_rh, pcmk__colocation_t *constraint, pe_working_set_t *data_set)
void group_rsc_location(pe_resource_t *rsc, pe__location_t *constraint)
void(* internal_constraints)(pe_resource_t *, pe_working_set_t *)
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)
pe_node_t *(* allocate)(pe_resource_t *, pe_node_t *, pe_working_set_t *)
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
#define order_stop_stop(rsc1, rsc2, type)
pe_resource_t * uber_parent(pe_resource_t *rsc)
void group_internal_constraints(pe_resource_t *rsc, pe_working_set_t *data_set)
void(* rsc_colocation_lh)(pe_resource_t *, pe_resource_t *, pcmk__colocation_t *, pe_working_set_t *)
#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
void(* expand)(pe_resource_t *, pe_working_set_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(* action_flags)(pe_action_t *, pe_node_t *)
#define pe_rsc_allocating
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)
#define promoted_key(rsc)
#define start_action(rsc, node, optional)
pe_node_t * pcmk__group_allocate(pe_resource_t *rsc, pe_node_t *prefer, pe_working_set_t *data_set)
void pe__set_next_role(pe_resource_t *rsc, enum rsc_role_e role, const char *why)
void(* rsc_location)(pe_resource_t *, pe__location_t *)
void group_expand(pe_resource_t *rsc, pe_working_set_t *data_set)
#define pe__clear_resource_flags(resource, flags_to_clear)
void(* create_actions)(pe_resource_t *, pe_working_set_t *)
void group_append_meta(pe_resource_t *rsc, xmlNode *xml)
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 order_start_start(rsc1, rsc2, type)
const char * node_attribute
gboolean crm_is_true(const char *s)
void group_rsc_colocation_rh(pe_resource_t *rsc_lh, pe_resource_t *rsc_rh, pcmk__colocation_t *constraint, pe_working_set_t *data_set)
#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)
pe_action_t * find_first_action(GList *input, const char *uuid, const char *task, pe_node_t *on_node)
#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
enum pe_action_flags group_action_flags(pe_action_t *action, pe_node_t *node)