20 #define VARIANT_GROUP 1 32 group_variant_data_t *group_data = NULL;
34 bool any_unmanaged =
false;
36 get_group_variant_data(group_data, rsc);
39 member = group_data->first_child;
58 for (GList *item = rsc->
children->next; item != NULL; item = item->next) {
61 for (GList *cons_iter = rsc->
rsc_cons; cons_iter != NULL;
62 cons_iter = cons_iter->next) {
78 member = group_data->last_child;
91 group_variant_data_t *group_data = NULL;
93 get_group_variant_data(group_data, rsc);
99 pe_rsc_debug(rsc,
"Dependency loop detected involving %s", rsc->
id);
103 if (group_data->first_child == NULL) {
110 rsc->
role = group_data->first_child->role;
112 expand_group_colocations(rsc);
118 for (; gIter != NULL; gIter = gIter->next) {
122 rsc->
id, child_rsc->
id);
124 if (group_node == NULL) {
130 "first group member");
133 if (group_data->colocated) {
145 const char *value = NULL;
150 for (; gIter != NULL; gIter = gIter->next) {
191 group_variant_data_t *group_data = NULL;
193 get_group_variant_data(group_data,
parent);
195 if (group_data->ordered == FALSE) {
200 if (group_data->child_stopping && group_data->child_starting) {
204 for (; gIter != NULL; gIter = gIter->next) {
213 group_data->child_stopping = TRUE;
218 group_data->child_starting = TRUE;
231 group_variant_data_t *group_data = NULL;
233 get_group_variant_data(group_data, rsc);
242 for (; gIter != NULL; gIter = gIter->next) {
252 if (last_rsc == NULL) {
253 if (group_data->ordered) {
258 }
else if (group_data->colocated) {
260 child_rsc, last_rsc, NULL, NULL,
293 if (group_data->ordered == FALSE) {
303 }
else if (last_rsc != NULL) {
329 if (group_data->ordered
335 last_active = child_rsc;
338 last_rsc = child_rsc;
341 if (group_data->ordered && last_rsc != NULL) {
364 group_variant_data_t *group_data = NULL;
366 if (dependent == NULL) {
367 pe_err(
"dependent was NULL for %s", constraint->
id);
370 }
else if (primary == NULL) {
371 pe_err(
"primary was NULL for %s", constraint->
id);
376 pe_rsc_trace(dependent,
"Processing constraints from %s", dependent->
id);
378 get_group_variant_data(group_data, dependent);
380 if (group_data->colocated) {
381 group_data->first_child->cmds->rsc_colocation_lh(group_data->first_child,
388 "between non-colocated group and %s",
389 dependent->
id, primary->
id);
393 for (; gIter != NULL; gIter = gIter->next) {
407 group_variant_data_t *group_data = NULL;
409 get_group_variant_data(group_data, primary);
412 pe_rsc_trace(primary,
"Processing RH %s of constraint %s (LH is %s)",
413 primary->
id, constraint->
id, dependent->
id);
418 }
else if (group_data->colocated && group_data->first_child) {
421 group_data->last_child->cmds->rsc_colocation_rh(dependent,
422 group_data->last_child,
427 group_data->first_child->cmds->rsc_colocation_rh(dependent,
428 group_data->first_child,
437 " non-colocated group %s", dependent->
id, primary->
id);
441 for (; gIter != NULL; gIter = gIter->next) {
455 for (gIter =
action->rsc->children; gIter != NULL; gIter = gIter->next) {
506 for (; gIter != NULL; gIter = gIter->next) {
526 gboolean reset_scores = TRUE;
527 group_variant_data_t *group_data = NULL;
529 get_group_variant_data(group_data, rsc);
531 pe_rsc_debug(rsc,
"Processing rsc_location %s for %s", constraint->
id, rsc->
id);
535 for (; gIter != NULL; gIter = gIter->next) {
539 if (group_data->colocated && reset_scores) {
540 reset_scores = FALSE;
546 g_list_free_full(zero, free);
557 for (GList *gIter = rsc->
children; gIter != NULL; gIter = gIter->next) {
566 GHashTable *nodes,
const char *attr,
float factor,
570 group_variant_data_t *group_data = NULL;
572 get_group_variant_data(group_data, rsc);
575 pe_rsc_info(rsc,
"Breaking dependency loop with %s at %s",
576 rsc->
id, primary_id);
582 nodes = group_data->first_child->cmds->merge_weights(group_data->first_child,
584 attr, factor,
flags);
586 for (; gIter != NULL; gIter = gIter->next) {
607 GList *colocated_rscs)
610 group_variant_data_t *group_data = NULL;
612 get_group_variant_data(group_data, rsc);
614 if (orig_rsc == NULL) {
618 if (group_data->colocated || pe_rsc_is_clone(rsc->
parent)) {
622 for (GList *gIter = rsc->
children; gIter != NULL; gIter = gIter->next) {
629 }
else if (group_data->first_child != NULL) {
633 child_rsc = group_data->first_child;
642 return colocated_rscs;
648 GList *all_rscs, GHashTable *utilization)
650 group_variant_data_t *group_data = NULL;
657 pe_rsc_trace(orig_rsc,
"%s: Adding group %s as colocated utilization",
658 orig_rsc->
id, rsc->
id);
659 get_group_variant_data(group_data, rsc);
660 if (group_data->colocated || pe_rsc_is_clone(rsc->
parent)) {
662 for (GList *iter = rsc->
children; iter != NULL; iter = iter->next) {
666 && (g_list_find(all_rscs, child) == NULL)) {
674 child = group_data->first_child;
677 && (g_list_find(all_rscs, child) == NULL)) {
689 for (GList *iter = rsc->
children; iter != NULL; iter = iter->next) {
GList * pcmk__copy_node_list(const GList *list, bool reset)
#define CRM_CHECK(expr, failure_action)
const char * task2text(enum action_tasks task)
void(* add_utilization)(pe_resource_t *rsc, pe_resource_t *orig_rsc, GList *all_rscs, GHashTable *utilization)
#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)
G_GNUC_INTERNAL GList * pcmk__colocated_resources(pe_resource_t *rsc, pe_resource_t *orig_rsc, GList *colocated_rscs)
#define pcmk__order_starts(rsc1, rsc2, type, data_set)
#define stop_action(rsc, node, optional)
void pcmk__group_add_utilization(pe_resource_t *rsc, pe_resource_t *orig_rsc, GList *all_rscs, GHashTable *utilization)
resource_alloc_functions_t * cmds
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 *dependent, pe_resource_t *primary, pcmk__colocation_t *constraint, pe_working_set_t *data_set)
pe_resource_t * dependent
void group_rsc_location(pe_resource_t *rsc, pe__location_t *constraint)
#define pcmk__order_stops(rsc1, rsc2, type, data_set)
GHashTable * pcmk__group_merge_weights(pe_resource_t *rsc, const char *primary_id, GHashTable *nodes, const char *attr, float factor, uint32_t flags)
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
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)
G_GNUC_INTERNAL void pcmk__new_colocation(const char *id, const char *node_attr, int score, pe_resource_t *dependent, pe_resource_t *primary, const char *dependent_role, const char *primary_role, bool influence, pe_working_set_t *data_set)
#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
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 *)
GList * pcmk__group_colocated_resources(pe_resource_t *rsc, pe_resource_t *orig_rsc, GList *colocated_rscs)
#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)
GList *(* colocated_resources)(pe_resource_t *rsc, pe_resource_t *orig_rsc, GList *colocated_rscs)
#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 *)
pe_working_set_t * data_set
#define pcmk__order_resource_actions(lh_rsc, lh_task, rh_rsc, rh_task, flags, data_set)
void group_rsc_colocation_rh(pe_resource_t *dependent, pe_resource_t *primary, pcmk__colocation_t *constraint, pe_working_set_t *data_set)
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
#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)
const char * node_attribute
gboolean crm_is_true(const char *s)
void pcmk__group_shutdown_lock(pe_resource_t *rsc)
void(* shutdown_lock)(pe_resource_t *rsc)
#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)
G_GNUC_INTERNAL void pcmk__apply_location(pe__location_t *constraint, pe_resource_t *rsc)
#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)
Create or update an action object.
GHashTable * allowed_nodes
enum pe_action_flags group_action_flags(pe_action_t *action, pe_node_t *node)