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

Function native_start_constraints

pengine/native.c:2375–2413  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2373}
2374
2375static void
2376native_start_constraints(resource_t * rsc, action_t * stonith_op, gboolean is_stonith,
2377 pe_working_set_t * data_set)
2378{
2379 node_t *target = stonith_op ? stonith_op->node : NULL;
2380
2381 GListPtr gIter = NULL;
2382 action_t *all_stopped = get_pseudo_op(ALL_STOPPED, data_set);
2383 action_t *stonith_done = get_pseudo_op(STONITH_DONE, data_set);
2384
2385 for (gIter = rsc->actions; gIter != NULL; gIter = gIter->next) {
2386 action_t *action = (action_t *) gIter->data;
2387
2388 if (action->needs == rsc_req_stonith) {
2389 order_actions(stonith_done, action, pe_order_optional);
2390
2391 } else if (target != NULL && safe_str_eq(action->task, RSC_START)
2392 && NULL == pe_hash_table_lookup(rsc->known_on, target->details->id)) {
2393 /* if known == NULL, then we dont know if
2394 * the resource is active on the node
2395 * we're about to shoot
2396 *
2397 * in this case, regardless of action->needs,
2398 * the only safe option is to wait until
2399 * the node is shot before doing anything
2400 * to with the resource
2401 *
2402 * its analogous to waiting for all the probes
2403 * for rscX to complete before starting rscX
2404 *
2405 * the most likely explaination is that the
2406 * DC died and took its status with it
2407 */
2408
2409 pe_rsc_debug(rsc, "Ordering %s after %s recovery", action->uuid, target->details->uname);
2410 order_actions(all_stopped, action, pe_order_optional | pe_order_runnable_left);
2411 }
2412 }
2413}
2414
2415static void
2416native_stop_constraints(resource_t * rsc, action_t * stonith_op, gboolean is_stonith,

Callers 1

rsc_stonith_orderingFunction · 0.85

Calls 3

get_pseudo_opFunction · 0.85
order_actionsFunction · 0.85
pe_hash_table_lookupFunction · 0.85

Tested by

no test coverage detected