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

Function native_create_probe

pengine/native.c:2277–2373  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2275}
2276
2277gboolean
2278native_create_probe(resource_t * rsc, node_t * node, action_t * complete,
2279 gboolean force, pe_working_set_t * data_set)
2280{
2281 char *key = NULL;
2282 action_t *probe = NULL;
2283 node_t *running = NULL;
2284 resource_t *top = uber_parent(rsc);
2285
2286 static const char *rc_master = NULL;
2287 static const char *rc_inactive = NULL;
2288
2289 if (rc_inactive == NULL) {
2290 rc_inactive = crm_itoa(PCMK_EXECRA_NOT_RUNNING);
2291 rc_master = crm_itoa(PCMK_EXECRA_RUNNING_MASTER);
2292 }
2293
2294 CRM_CHECK(node != NULL, return FALSE);
2295 if (force == FALSE && is_not_set(data_set->flags, pe_flag_startup_probes)) {
2296 pe_rsc_trace(rsc, "Skipping active resource detection for %s", rsc->id);
2297 return FALSE;
2298 }
2299
2300 if (rsc->children) {
2301 GListPtr gIter = NULL;
2302 gboolean any_created = FALSE;
2303
2304 for (gIter = rsc->children; gIter != NULL; gIter = gIter->next) {
2305 resource_t *child_rsc = (resource_t *) gIter->data;
2306
2307 any_created = child_rsc->cmds->create_probe(child_rsc, node, complete, force, data_set)
2308 || any_created;
2309 }
2310
2311 return any_created;
2312 }
2313
2314 if (is_set(rsc->flags, pe_rsc_orphan)) {
2315 pe_rsc_trace(rsc, "Skipping orphan: %s", rsc->id);
2316 return FALSE;
2317 }
2318
2319 running = g_hash_table_lookup(rsc->known_on, node->details->id);
2320 if (running == NULL && is_set(rsc->flags, pe_rsc_unique) == FALSE) {
2321 /* Anonymous clones */
2322 if (rsc->parent == top) {
2323 running = g_hash_table_lookup(rsc->parent->known_on, node->details->id);
2324
2325 } else {
2326 /* Grouped anonymous clones need extra special handling */
2327 running = probe_grouped_clone(rsc, node, data_set);
2328 }
2329 }
2330
2331 if (force == FALSE && running != NULL) {
2332 /* we already know the status of the resource on this node */
2333 pe_rsc_trace(rsc, "Skipping active: %s on %s", rsc->id, node->details->uname);
2334 return FALSE;

Callers

nothing calls this directly

Calls 13

uber_parentFunction · 0.85
crm_itoaFunction · 0.85
is_not_setFunction · 0.85
is_setFunction · 0.85
probe_grouped_cloneFunction · 0.85
generate_op_keyFunction · 0.85
custom_actionFunction · 0.85
update_action_flagsFunction · 0.85
pe_fence_opFunction · 0.85
order_actionsFunction · 0.85
pe_find_node_idFunction · 0.85
add_hash_paramFunction · 0.85

Tested by

no test coverage detected