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

Function native_stop_constraints

pengine/native.c:2415–2559  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2413}
2414
2415static void
2416native_stop_constraints(resource_t * rsc, action_t * stonith_op, gboolean is_stonith,
2417 pe_working_set_t * data_set)
2418{
2419 char *key = NULL;
2420 GListPtr gIter = NULL;
2421 GListPtr action_list = NULL;
2422 resource_t *top = uber_parent(rsc);
2423
2424 key = stop_key(rsc);
2425 action_list = find_actions(rsc->actions, key, stonith_op->node);
2426 free(key);
2427
2428 /* add the stonith OP as a stop pre-req and the mark the stop
2429 * as a pseudo op - since its now redundant
2430 */
2431
2432 for (gIter = action_list; gIter != NULL; gIter = gIter->next) {
2433 action_t *action = (action_t *) gIter->data;
2434
2435 if (action->node->details->online
2436 && action->node->details->unclean == FALSE && is_set(rsc->flags, pe_rsc_failed)) {
2437 continue;
2438 }
2439
2440 if (is_set(rsc->flags, pe_rsc_failed)) {
2441 crm_notice("Stop of failed resource %s is"
2442 " implicit after %s is fenced", rsc->id, action->node->details->uname);
2443 } else {
2444 crm_info("%s is implicit after %s is fenced",
2445 action->uuid, action->node->details->uname);
2446 }
2447
2448 /* the stop would never complete and is
2449 * now implied by the stonith operation
2450 */
2451 update_action_flags(action, pe_action_pseudo);
2452 update_action_flags(action, pe_action_runnable);
2453 update_action_flags(action, pe_action_implied_by_stonith);
2454
2455 {
2456 action_t *parent_stop = find_first_action(top->actions, NULL, RSC_STOP, NULL);
2457
2458 order_actions(stonith_op, action, pe_order_optional);
2459 order_actions(stonith_op, parent_stop, pe_order_optional);
2460 }
2461
2462 if (is_set(rsc->flags, pe_rsc_notify)) {
2463 /* Create a second notification that will be delivered
2464 * immediately after the node is fenced
2465 *
2466 * Basic problem:
2467 * - C is a clone active on the node to be shot and stopping on another
2468 * - R is a resource that depends on C
2469 *
2470 * + C.stop depends on R.stop
2471 * + C.stopped depends on STONITH
2472 * + C.notify depends on C.stopped

Callers 1

rsc_stonith_orderingFunction · 0.85

Calls 10

uber_parentFunction · 0.85
find_actionsFunction · 0.85
is_setFunction · 0.85
update_action_flagsFunction · 0.85
find_first_actionFunction · 0.85
order_actionsFunction · 0.85
create_notificationsFunction · 0.85
free_notification_dataFunction · 0.85

Tested by

no test coverage detected