MCPcopy Create free account
hub / github.com/ClusterLabs/pacemaker / clone_rsc_colocation_rh

Function clone_rsc_colocation_rh

pengine/clone.c:1007–1086  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1005}
1006
1007void
1008clone_rsc_colocation_rh(resource_t * rsc_lh, resource_t * rsc_rh, rsc_colocation_t * constraint)
1009{
1010 GListPtr gIter = NULL;
1011 gboolean do_interleave = FALSE;
1012 clone_variant_data_t *clone_data = NULL;
1013 clone_variant_data_t *clone_data_lh = NULL;
1014
1015 CRM_CHECK(constraint != NULL, return);
1016 CRM_CHECK(rsc_lh != NULL, pe_err("rsc_lh was NULL for %s", constraint->id); return);
1017 CRM_CHECK(rsc_rh != NULL, pe_err("rsc_rh was NULL for %s", constraint->id); return);
1018 CRM_CHECK(rsc_lh->variant == pe_native, return);
1019
1020 get_clone_variant_data(clone_data, constraint->rsc_rh);
1021 pe_rsc_trace(rsc_rh, "Processing constraint %s: %s -> %s %d",
1022 constraint->id, rsc_lh->id, rsc_rh->id, constraint->score);
1023
1024 if (constraint->rsc_lh->variant >= pe_clone) {
1025
1026 get_clone_variant_data(clone_data_lh, constraint->rsc_lh);
1027 if (clone_data_lh->interleave && clone_data->clone_node_max != clone_data_lh->clone_node_max) {
1028 crm_config_err("Cannot interleave " XML_CIB_TAG_INCARNATION
1029 " %s and %s because"
1030 " they do not support the same number of"
1031 " resources per node", constraint->rsc_lh->id, constraint->rsc_rh->id);
1032
1033 /* only the LHS side needs to be labeled as interleave */
1034 } else if (clone_data_lh->interleave) {
1035 do_interleave = TRUE;
1036 }
1037 }
1038
1039 if (is_set(rsc_rh->flags, pe_rsc_provisional)) {
1040 pe_rsc_trace(rsc_rh, "%s is still provisional", rsc_rh->id);
1041 return;
1042
1043 } else if (do_interleave) {
1044 resource_t *rh_child = NULL;
1045
1046 rh_child = find_compatible_child(rsc_lh, rsc_rh, RSC_ROLE_UNKNOWN, FALSE);
1047
1048 if (rh_child) {
1049 pe_rsc_debug(rsc_rh, "Pairing %s with %s", rsc_lh->id, rh_child->id);
1050 rsc_lh->cmds->rsc_colocation_lh(rsc_lh, rh_child, constraint);
1051
1052 } else if (constraint->score >= INFINITY) {
1053 crm_notice("Cannot pair %s with instance of %s", rsc_lh->id, rsc_rh->id);
1054 assign_node(rsc_lh, NULL, TRUE);
1055
1056 } else {
1057 pe_rsc_debug(rsc_rh, "Cannot pair %s with instance of %s", rsc_lh->id, rsc_rh->id);
1058 }
1059
1060 return;
1061
1062 } else if (constraint->score >= INFINITY) {
1063 GListPtr rhs = NULL;
1064

Callers 1

master_rsc_colocation_rhFunction · 0.85

Calls 4

is_setFunction · 0.85
find_compatible_childFunction · 0.85
assign_nodeFunction · 0.85
node_list_excludeFunction · 0.85

Tested by

no test coverage detected