37 pe_rsc_debug(rsc,
"Breaking assignment loop involving %s", rsc->
id);
51 for (GList *iter = rsc->
rsc_cons; iter != NULL; iter = iter->next) {
54 pe_rsc_trace(rsc,
"%s: Assigning colocation %s primary %s first",
87 for (GList *item = actions; item != NULL; item = item->next) {
118 for (GList *iter = rsc->
children; iter != NULL; iter = iter->next) {
126 if (last_stop != NULL) {
135 if (last_start != NULL) {
149 order_instance_starts_stops(rsc);
182 for (gIter = rsc->
children; gIter != NULL; gIter = gIter->next) {
191 if (ordered && (last_rsc != NULL)) {
198 if (ordered && (last_rsc != NULL)) {
202 last_rsc = child_rsc;
229 gboolean do_interleave = FALSE;
230 const char *interleave_s = NULL;
238 CRM_CHECK((colocation != NULL) && (dependent != NULL) && (primary != NULL),
242 pe_rsc_trace(primary,
"Processing constraint %s: %s -> %s %d",
243 colocation->
id, dependent->
id, primary->
id, colocation->
score);
253 pe_rsc_trace(primary,
"Handling %s as a clone colocation",
271 interleave_s = g_hash_table_lookup(colocation->
dependent->
meta,
280 "support the same number of instances per node",
285 do_interleave = TRUE;
293 }
else if (do_interleave) {
299 if (primary_instance != NULL) {
301 dependent->
id, primary_instance->
id);
306 crm_notice(
"Cannot pair %s with instance of %s",
307 dependent->
id, primary->
id);
311 pe_rsc_debug(primary,
"Cannot pair %s with instance of %s",
312 dependent->
id, primary->
id);
318 GList *affected_nodes = NULL;
321 for (; gIter != NULL; gIter = gIter->next) {
327 colocation->
id, pe__node_name(chosen),
329 affected_nodes = g_list_prepend(affected_nodes, chosen);
334 g_list_free(affected_nodes);
339 for (; gIter != NULL; gIter = gIter->next) {
352 CRM_CHECK((rsc != NULL) && (orig_rsc != NULL) && (list != NULL),
return);
354 if (rsc == orig_rsc) {
366 CRM_CHECK((rsc != NULL) && (orig_rsc != NULL) && (list != NULL),
return);
368 if (rsc == orig_rsc) {
386 pe_rsc_trace(rsc,
"Processing location constraint %s for %s", constraint->
id, rsc->
id);
390 for (; gIter != NULL; gIter = gIter->next) {
415 for (; gIter != NULL; gIter = gIter->next) {
432 for (GList *child_iter = rsc->
children; child_iter != NULL;
433 child_iter = child_iter->next) {
437 if (rsc_known_on(child, node)) {
446 g_hash_table_iter_init(&iter, rsc->
known_on);
447 while (g_hash_table_iter_next(&iter, NULL, (gpointer *) &known_node)) {
448 if (node->
details == known_node->details) {
460 for (GList *gIter = clone->
children; gIter != NULL; gIter = gIter->next) {
463 if (rsc_known_on(child, node)) {
480 for (GList *child_iter = rsc->
children; child_iter && !child;
481 child_iter = child_iter->next) {
487 local_node = child_rsc->
fns->
location(child_rsc, NULL, FALSE);
520 pe_warn(
"Clone %s has no children", rsc->
id);
544 return probe_anonymous_clone(rsc, node, rsc->
cluster);
598 GHashTable *utilization)
600 bool existing =
false;
608 for (GList *iter = rsc->
children; iter != NULL; iter = iter->next) {
610 if (g_list_find(all_rscs, child)) {
614 for (GList *member_iter = child->
children; member_iter != NULL;
615 member_iter = member_iter->next) {
619 if (g_list_find(all_rscs, member) != NULL) {
630 if (!existing && (rsc->
children != NULL)) {
#define CRM_CHECK(expr, failure_action)
#define PCMK_XA_PROMOTED_MAX_LEGACY
#define pcmk__order_starts(rsc1, rsc2, flags)
G_GNUC_INTERNAL void pcmk__add_this_with_list(GList **list, GList *addition)
#define crm_notice(fmt, args...)
G_GNUC_INTERNAL void pcmk__add_rsc_actions_to_graph(pe_resource_t *rsc)
#define pe_rsc_debug(rsc, fmt, args...)
#define pe__show_node_weights(level, rsc, text, nodes, data_set)
void(* internal_constraints)(pe_resource_t *rsc)
void pe__free_clone_notification_data(pe_resource_t *clone)
G_GNUC_INTERNAL pe_resource_t * pcmk__find_compatible_instance(const pe_resource_t *match_rsc, const pe_resource_t *rsc, enum rsc_role_e role, bool current)
resource_alloc_functions_t * cmds
int pe__clone_promoted_max(const pe_resource_t *clone)
#define pcmk__order_stops(rsc1, rsc2, flags)
void pcmk__clone_shutdown_lock(pe_resource_t *rsc)
const char * crm_xml_add_int(xmlNode *node, const char *name, int value)
Create an XML attribute with specified name and integer value.
gboolean exclusive_discover
void clone_create_actions(pe_resource_t *rsc)
#define pcmk__config_err(fmt...)
G_GNUC_INTERNAL void pcmk__set_instance_roles(pe_resource_t *rsc)
resource_object_functions_t * fns
const char * crm_xml_add(xmlNode *node, const char *name, const char *value)
Create an XML attribute with specified name and value.
pe_resource_t * dependent
void node_list_exclude(GHashTable *list, GList *list2, gboolean merge_scores)
#define XML_RSC_ATTR_INCARNATION_MAX
void(* add_actions_to_graph)(pe_resource_t *rsc)
int pe__clone_max(const pe_resource_t *clone)
void clone_internal_constraints(pe_resource_t *rsc)
char * crm_meta_name(const char *field)
void pcmk__clone_with_colocations(const pe_resource_t *rsc, const pe_resource_t *orig_rsc, GList **list)
#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 PCMK_XA_PROMOTED_NODE_MAX_LEGACY
#define pe_rsc_provisional
pe_node_t *(* location)(const pe_resource_t *, GList **, int)
int pe__clone_node_max(const pe_resource_t *clone)
enum pe_action_flags clone_action_flags(pe_action_t *action, const pe_node_t *node)
G_GNUC_INTERNAL void pcmk__order_promotable_instances(pe_resource_t *clone)
G_GNUC_INTERNAL bool pcmk__probe_resource_list(GList *rscs, pe_node_t *node)
#define pcmk_is_set(g, f)
Convenience alias for pcmk_all_flags_set(), to check single flag.
int pe__clone_promoted_node_max(const pe_resource_t *clone)
struct pe_node_shared_s * details
G_GNUC_INTERNAL gint pcmk__cmp_instance(gconstpointer a, gconstpointer b)
gboolean order_actions(pe_action_t *lh_action, pe_action_t *rh_action, enum pe_ordering order)
#define pe_rsc_promotable
pe_working_set_t * data_set
#define XML_RSC_ATTR_INCARNATION_NODEMAX
bool is_set_recursive(const pe_resource_t *rsc, long long flag, bool any)
G_GNUC_INTERNAL void pcmk__add_with_this_list(GList **list, GList *addition)
G_GNUC_INTERNAL gint pcmk__cmp_instance_number(gconstpointer a, gconstpointer b)
#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)
#define XML_RSC_ATTR_NOTIFY
#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)
#define XML_RSC_ATTR_UNIQUE
G_GNUC_INTERNAL void pcmk__update_dependent_with_promotable(const pe_resource_t *primary, pe_resource_t *dependent, const pcmk__colocation_t *colocation)
Update dependent for a colocation with a promotable clone.
G_GNUC_INTERNAL void pcmk__apply_location(pe_resource_t *rsc, pe__location_t *constraint)
#define XML_RSC_ATTR_PROMOTED_MAX
bool(* create_probe)(pe_resource_t *rsc, pe_node_t *node)
void pcmk__clone_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__add_dependent_scores(gpointer data, gpointer user_data)
void clone_rsc_location(pe_resource_t *rsc, pe__location_t *constraint)
bool pe__clone_is_ordered(const pe_resource_t *clone)
G_GNUC_INTERNAL void pcmk__create_promotable_actions(pe_resource_t *clone)
G_GNUC_INTERNAL void pcmk__update_promotable_dependent_priority(const pe_resource_t *primary, pe_resource_t *dependent, const pcmk__colocation_t *colocation)
G_GNUC_INTERNAL bool pcmk__assign_resource(pe_resource_t *rsc, pe_node_t *node, bool force)
G_GNUC_INTERNAL void pcmk__create_instance_actions(pe_resource_t *rsc, GList *instances)
pe_node_t * pcmk__clone_assign(pe_resource_t *rsc, const pe_node_t *prefer)
#define pe__clear_resource_flags(resource, flags_to_clear)
G_GNUC_INTERNAL void pcmk__add_promotion_scores(pe_resource_t *rsc)
void clone_expand(pe_resource_t *rsc)
#define XML_RSC_ATTR_PROMOTED_NODEMAX
enum pe_action_flags flags
G_GNUC_INTERNAL void pcmk__assign_instances(pe_resource_t *collective, GList *instances, int max_total, int max_per_node)
pe_working_set_t * cluster
bool clone_create_probe(pe_resource_t *rsc, pe_node_t *node)
void pe__create_clone_notifications(pe_resource_t *clone)
gboolean crm_is_true(const char *s)
void(* apply_location)(pe_resource_t *rsc, pe__location_t *location)
#define pe_rsc_trace(rsc, fmt, args...)
#define XML_RSC_ATTR_INTERLEAVE
GList * pe__resource_actions(const pe_resource_t *rsc, const pe_node_t *node, const char *task, bool require_node)
Find all actions of given type for a resource.
G_GNUC_INTERNAL void pcmk__add_collective_constraints(GList **list, const pe_resource_t *instance, const pe_resource_t *collective, bool with_this)
#define pe_flag_show_scores
void clone_append_meta(const pe_resource_t *rsc, xmlNode *xml)
void pcmk__clone_add_utilization(const pe_resource_t *rsc, const pe_resource_t *orig_rsc, GList *all_rscs, GHashTable *utilization)
int copies_per_node(pe_resource_t *rsc)
GHashTable * allowed_nodes
G_GNUC_INTERNAL enum pe_action_flags pcmk__collective_action_flags(pe_action_t *action, const GList *instances, const pe_node_t *node)
void pcmk__with_clone_colocations(const pe_resource_t *rsc, const pe_resource_t *orig_rsc, GList **list)