40 pe_rsc_debug(rsc,
"Assignment dependency loop detected involving %s",
58 for (GList *iter = rsc->
children; iter != NULL; iter = iter->next) {
65 if (first_assigned_node == NULL) {
66 first_assigned_node = node;
76 return first_assigned_node;
111 for (GList *iter = rsc->
children; iter != NULL; iter = iter->next) {
120 create_group_pseudo_op(rsc,
RSC_STOP);
149 member_internal_constraints(gpointer
data, gpointer user_data)
152 struct member_data *member_data = (
struct member_data *) user_data;
163 if (member_data->previous_member == NULL) {
165 if (member_data->ordered) {
170 }
else if (member_data->colocated) {
173 member, member_data->previous_member, NULL, NULL,
178 if (member_data->promotable) {
209 if (!member_data->ordered) {
214 if (member_data->promotable) {
222 }
else if (member_data->previous_member == NULL) {
224 if (member_data->promotable) {
244 && (member_data->previous_member->running_on == NULL)) {
251 if (member_data->promotable) {
257 member_data->previous_member,
264 if (member_data->ordered && (member_data->previous_member != NULL)
265 && (member_data->previous_member->running_on == NULL)
266 && (member_data->last_active != NULL)
267 && (member_data->last_active->running_on != NULL)) {
270 member_data->last_active = member;
273 member_data->previous_member = member;
285 struct member_data member_data = {
false, };
303 g_list_foreach(rsc->
children, member_internal_constraints, &member_data);
328 pe_rsc_trace(primary,
"Processing %s (group %s with %s) for dependent",
329 colocation->
id, dependent->
id, primary->
id);
340 "non-colocated group and %s",
341 dependent->
id, primary->
id);
346 for (GList *iter = dependent->
children; iter != NULL; iter = iter->next) {
371 "Processing colocation %s (%s with group %s) for primary",
372 colocation->
id, dependent->
id, primary->
id);
386 }
else if (primary->
children != NULL) {
393 if (member == NULL) {
403 " non-colocated group %s",
404 dependent->
id, primary->
id);
409 for (GList *iter = primary->
children; iter != NULL; iter = iter->next) {
434 CRM_ASSERT((dependent != NULL) && (primary != NULL)
435 && (colocation != NULL));
438 colocate_group_with(dependent, primary, colocation);
444 colocate_with_group(dependent, primary, colocation);
468 for (GList *iter =
action->rsc->children; iter != NULL; iter = iter->next) {
477 if (member_action != NULL) {
509 "%s is not runnable because %s will not %s",
544 uint32_t filter, uint32_t
type,
559 for (GList *iter = then->
rsc->
children; iter != NULL; iter = iter->next) {
565 if (member_action != NULL) {
585 GList *node_list_orig = NULL;
586 GList *node_list_copy = NULL;
587 bool reset_scores =
true;
589 CRM_ASSERT((rsc != NULL) && (location != NULL));
599 for (GList *iter = rsc->
children; iter != NULL; iter = iter->next) {
609 reset_scores =
false;
615 g_list_free_full(node_list_copy, free);
622 GList *colocated_rscs)
628 if (orig_rsc == NULL) {
633 || pe_rsc_is_clone(rsc->
parent)) {
638 colocated_rscs = g_list_prepend(colocated_rscs, (gpointer) rsc);
639 for (
const GList *iter = rsc->children;
640 iter != NULL; iter = iter->next) {
654 return colocated_rscs;
664 && (orig_rsc != NULL) && (list != NULL),
677 crm_trace(
"Adding 'with %s' colocations to list for %s",
678 rsc->
id, orig_rsc->
id);
680 if (rsc->
parent != NULL) {
693 && (orig_rsc != NULL) && (list != NULL),
704 if ((rsc == orig_rsc)
706 crm_trace(
"Adding '%s with' colocations to list for %s",
707 rsc->
id, orig_rsc->
id);
709 if (rsc->
parent != NULL) {
721 for (GList *iter = rsc->
children; iter != NULL; iter = iter->next) {
724 if (orig_rsc == member) {
729 crm_trace(
"Adding mandatory '%s with' colocations to list for " 730 "member %s because earlier member %s is unmanaged",
731 rsc->
id, orig_rsc->
id, member->
id);
732 for (
const GList *cons_iter = rsc->
rsc_cons; cons_iter != NULL;
733 cons_iter = cons_iter->next) {
766 GHashTable **nodes,
const char *attr,
767 float factor, uint32_t
flags)
771 CRM_CHECK((rsc != NULL) && (nodes != NULL),
return);
773 if (log_id == NULL) {
779 pe_rsc_info(rsc,
"%s: Breaking dependency loop at %s",
800 if (*nodes == NULL) {
805 pe_rsc_trace(rsc,
"%s: Merging scores from group %s using member %s " 806 "(at %.6f)", log_id, rsc->
id, member->
id, factor);
816 GHashTable *utilization)
820 CRM_ASSERT((rsc != NULL) && (orig_rsc != NULL) && (utilization != NULL));
826 pe_rsc_trace(orig_rsc,
"%s: Adding group %s as colocated utilization",
827 orig_rsc->
id, rsc->
id);
829 || pe_rsc_is_clone(rsc->
parent)) {
831 for (GList *iter = rsc->
children; iter != NULL; iter = iter->next) {
835 && (g_list_find(all_rscs, member) == NULL)) {
846 && (g_list_find(all_rscs, member) == NULL)) {
860 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)
#define pcmk__order_starts(rsc1, rsc2, flags)
G_GNUC_INTERNAL void pcmk__add_this_with_list(GList **list, GList *addition)
#define pe_rsc_debug(rsc, fmt, args...)
GList * pcmk__group_colocated_resources(const pe_resource_t *rsc, const pe_resource_t *orig_rsc, GList *colocated_rscs)
#define pe__set_action_flags(action, flags_to_set)
G_GNUC_INTERNAL uint32_t pcmk__update_ordered_actions(pe_action_t *first, pe_action_t *then, const pe_node_t *node, uint32_t flags, uint32_t filter, uint32_t type, pe_working_set_t *data_set)
#define pe__show_node_weights(level, rsc, text, nodes, data_set)
void pcmk__group_internal_constraints(pe_resource_t *rsc)
void(* internal_constraints)(pe_resource_t *rsc)
resource_alloc_functions_t * cmds
#define pcmk__order_stops(rsc1, rsc2, flags)
enum rsc_role_e next_role
pe_action_t * find_first_action(const GList *input, const char *uuid, const char *task, const pe_node_t *on_node)
#define pcmk__config_err(fmt...)
void(* with_this_colocations)(const pe_resource_t *rsc, const pe_resource_t *orig_rsc, GList **list)
const pe_resource_t * pe__const_top_resource(const pe_resource_t *rsc, bool include_bundle)
enum crm_ais_msg_types type
void pcmk__group_apply_coloc_score(pe_resource_t *dependent, const pe_resource_t *primary, const pcmk__colocation_t *colocation, bool for_dependent)
void pcmk__group_apply_location(pe_resource_t *rsc, pe__location_t *location)
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)
pe_node_t *(* assign)(pe_resource_t *rsc, const pe_node_t *prefer)
enum pe_action_flags(* action_flags)(pe_action_t *action, const pe_node_t *node)
#define pe_rsc_provisional
void pcmk__group_create_actions(pe_resource_t *rsc)
#define XML_RSC_ATTR_PROMOTABLE
GList *(* colocated_resources)(const pe_resource_t *rsc, const pe_resource_t *orig_rsc, GList *colocated_rscs)
void pcmk__group_add_utilization(const pe_resource_t *rsc, const pe_resource_t *orig_rsc, GList *all_rscs, GHashTable *utilization)
#define pe__clear_action_flags(action, flags_to_clear)
#define crm_trace(fmt, args...)
#define pcmk_is_set(g, f)
Convenience alias for pcmk_all_flags_set(), to check single flag.
#define pe_rsc_promotable
pe_working_set_t * data_set
void(* create_actions)(pe_resource_t *rsc)
void pcmk__with_group_colocations(const pe_resource_t *rsc, const pe_resource_t *orig_rsc, GList **list)
G_GNUC_INTERNAL void pcmk__add_with_this_list(GList **list, GList *addition)
#define pe_rsc_allocating
enum pe_obj_types variant
void(* add_utilization)(const pe_resource_t *rsc, const pe_resource_t *orig_rsc, GList *all_rscs, GHashTable *utilization)
void(* this_with_colocations)(const pe_resource_t *rsc, const pe_resource_t *orig_rsc, GList **list)
void pcmk__group_with_colocations(const pe_resource_t *rsc, const pe_resource_t *orig_rsc, GList **list)
char * pcmk__op_key(const char *rsc_id, const char *op_type, guint interval_ms)
Generate an operation key (RESOURCE_ACTION_INTERVAL)
#define pcmk__order_resource_actions(first_rsc, first_task, then_rsc, then_task, flags)
void(* apply_coloc_score)(pe_resource_t *dependent, const pe_resource_t *primary, const pcmk__colocation_t *colocation, bool for_dependent)
G_GNUC_INTERNAL void pcmk__apply_location(pe_resource_t *rsc, pe__location_t *constraint)
pe_resource_t * pe__last_group_member(const pe_resource_t *group)
G_GNUC_INTERNAL GList * pcmk__colocated_resources(const pe_resource_t *rsc, const pe_resource_t *orig_rsc, GList *colocated_rscs)
G_GNUC_INTERNAL void pcmk__add_this_with(GList **list, const pcmk__colocation_t *colocation)
void pe__set_next_role(pe_resource_t *rsc, enum rsc_role_e role, const char *why)
#define pe__clear_resource_flags(resource, flags_to_clear)
enum pe_action_flags pcmk__group_action_flags(pe_action_t *action, const pe_node_t *node)
pe_working_set_t * cluster
pe_node_t * pcmk__group_assign(pe_resource_t *rsc, const pe_node_t *prefer)
enum action_tasks get_complex_task(const pe_resource_t *rsc, const char *name)
gboolean crm_is_true(const char *s)
void pcmk__group_shutdown_lock(pe_resource_t *rsc)
void(* shutdown_lock)(pe_resource_t *rsc)
void(* apply_location)(pe_resource_t *rsc, pe__location_t *location)
#define pe_rsc_trace(rsc, fmt, args...)
#define pe__set_order_flags(order_flags, flags_to_set)
bool pe__group_flag_is_set(const pe_resource_t *group, uint32_t flags)
void pcmk__group_add_colocated_node_scores(pe_resource_t *rsc, const char *log_id, GHashTable **nodes, const char *attr, float factor, uint32_t flags)
uint32_t(* update_ordered_actions)(pe_action_t *first, pe_action_t *then, const pe_node_t *node, uint32_t flags, uint32_t filter, uint32_t type, pe_working_set_t *data_set)
uint32_t pcmk__group_update_ordered_actions(pe_action_t *first, pe_action_t *then, const pe_node_t *node, uint32_t flags, uint32_t filter, uint32_t type, pe_working_set_t *data_set)
pe_action_t * custom_action(pe_resource_t *rsc, char *key, const char *task, const pe_node_t *on_node, gboolean optional, gboolean foo, pe_working_set_t *data_set)
Create or update an action object.
#define pe_flag_show_scores
#define pe__clear_raw_action_flags(action_flags, action_name, flags_to_clear)
void(* add_colocated_node_scores)(pe_resource_t *rsc, const char *log_id, GHashTable **nodes, const char *attr, float factor, uint32_t flags)
#define pe_rsc_info(rsc, fmt, args...)
GHashTable * allowed_nodes