| 2373 | } |
| 2374 | |
| 2375 | static void |
| 2376 | native_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 | |
| 2415 | static void |
| 2416 | native_stop_constraints(resource_t * rsc, action_t * stonith_op, gboolean is_stonith, |
no test coverage detected