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

Function process_orphan_resource

lib/pengine/unpack.c:1173–1213  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1171}
1172
1173static resource_t *
1174process_orphan_resource(xmlNode * rsc_entry, node_t * node, pe_working_set_t * data_set)
1175{
1176 resource_t *rsc = NULL;
1177 const char *rsc_id = crm_element_value(rsc_entry, XML_ATTR_ID);
1178
1179 crm_debug("Detected orphan resource %s on %s", rsc_id, node->details->uname);
1180 rsc = create_fake_resource(rsc_id, rsc_entry, data_set);
1181
1182 if (is_set(data_set->flags, pe_flag_stop_rsc_orphans) == FALSE) {
1183 clear_bit(rsc->flags, pe_rsc_managed);
1184
1185 } else {
1186 GListPtr gIter = NULL;
1187
1188 print_resource(LOG_DEBUG_3, "Added orphan", rsc, FALSE);
1189
1190 CRM_CHECK(rsc != NULL, return NULL);
1191 resource_location(rsc, NULL, -INFINITY, "__orphan_dont_run__", data_set);
1192
1193 for (gIter = data_set->nodes; gIter != NULL; gIter = gIter->next) {
1194 node_t *node = (node_t *) gIter->data;
1195
1196 if (node->details->online && get_failcount(node, rsc, NULL, data_set)) {
1197 action_t *clear_op = NULL;
1198 action_t *ready = get_pseudo_op(CRM_OP_PROBED, data_set);
1199
1200 clear_op = custom_action(rsc, crm_concat(rsc->id, CRM_OP_CLEAR_FAILCOUNT, '_'),
1201 CRM_OP_CLEAR_FAILCOUNT, node, FALSE, TRUE, data_set);
1202
1203 add_hash_param(clear_op->meta, XML_ATTR_TE_NOWAIT, XML_BOOLEAN_TRUE);
1204 pe_rsc_info(rsc, "Clearing failcount (%d) for orphaned resource %s on %s (%s)",
1205 get_failcount(node, rsc, NULL, data_set), rsc->id, node->details->uname,
1206 clear_op->uuid);
1207
1208 order_actions(clear_op, ready, pe_order_optional);
1209 }
1210 }
1211 }
1212 return rsc;
1213}
1214
1215static void
1216process_rsc_state(resource_t * rsc, node_t * node,

Callers 1

unpack_lrm_rsc_stateFunction · 0.85

Calls 11

crm_element_valueFunction · 0.85
create_fake_resourceFunction · 0.85
is_setFunction · 0.85
print_resourceFunction · 0.85
resource_locationFunction · 0.85
get_failcountFunction · 0.85
get_pseudo_opFunction · 0.85
custom_actionFunction · 0.85
crm_concatFunction · 0.85
add_hash_paramFunction · 0.85
order_actionsFunction · 0.85

Tested by

no test coverage detected