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

Function rsc_order_then

pengine/allocate.c:1408–1459  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1406}
1407
1408static void
1409rsc_order_then(action_t * lh_action, resource_t * rsc, order_constraint_t * order)
1410{
1411 GListPtr gIter = NULL;
1412 GListPtr rh_actions = NULL;
1413 action_t *rh_action = NULL;
1414 enum pe_ordering type = order->type;
1415
1416 CRM_CHECK(rsc != NULL, return);
1417 CRM_CHECK(order != NULL, return);
1418
1419 rh_action = order->rh_action;
1420 crm_trace("Processing RH of ordering constraint %d", order->id);
1421
1422 if (rh_action != NULL) {
1423 rh_actions = g_list_prepend(NULL, rh_action);
1424
1425 } else if (rsc != NULL) {
1426 rh_actions = find_actions_by_task(rsc->actions, rsc, order->rh_action_task);
1427 }
1428
1429 if (rh_actions == NULL) {
1430 pe_rsc_trace(rsc, "No RH-Side (%s/%s) found for constraint..."
1431 " ignoring", rsc->id, order->rh_action_task);
1432 if (lh_action) {
1433 pe_rsc_trace(rsc, "LH-Side was: %s", lh_action->uuid);
1434 }
1435 return;
1436 }
1437
1438 if (lh_action && lh_action->rsc == rsc && is_set(lh_action->flags, pe_action_dangle)) {
1439 pe_rsc_trace(rsc, "Detected dangling operation %s -> %s", lh_action->uuid, order->rh_action_task);
1440 clear_bit(type, pe_order_implies_then);
1441 }
1442
1443 gIter = rh_actions;
1444 for (; gIter != NULL; gIter = gIter->next) {
1445 action_t *rh_action_iter = (action_t *) gIter->data;
1446
1447 if (lh_action) {
1448 order_actions(lh_action, rh_action_iter, type);
1449
1450 } else if (type & pe_order_implies_then) {
1451 update_action_flags(rh_action_iter, pe_action_runnable | pe_action_clear);
1452 crm_warn("Unrunnable %s 0x%.6x", rh_action_iter->uuid, type);
1453 } else {
1454 crm_warn("neither %s 0x%.6x", rh_action_iter->uuid, type);
1455 }
1456 }
1457
1458 g_list_free(rh_actions);
1459}
1460
1461static void
1462rsc_order_first(resource_t * lh_rsc, order_constraint_t * order, pe_working_set_t * data_set)

Callers 2

rsc_order_firstFunction · 0.85
stage7Function · 0.85

Calls 4

find_actions_by_taskFunction · 0.85
is_setFunction · 0.85
order_actionsFunction · 0.85
update_action_flagsFunction · 0.85

Tested by

no test coverage detected