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

Function check_stack_element

pengine/native.c:2632–2715  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2630}
2631
2632static enum stack_activity
2633check_stack_element(resource_t * rsc, resource_t * other_rsc, const char *type)
2634{
2635 resource_t *other_p = uber_parent(other_rsc);
2636
2637 if (other_rsc == NULL || other_rsc == rsc) {
2638 return stack_stable;
2639
2640 } else if (other_p->variant == pe_native) {
2641 crm_notice("Cannot migrate %s due to dependency on %s (%s)", rsc->id, other_rsc->id, type);
2642 return stack_middle;
2643
2644 } else if (other_rsc == rsc->parent) {
2645 int mode = 0;
2646 GListPtr gIter = NULL;
2647
2648 for (gIter = other_rsc->rsc_cons; gIter != NULL; gIter = gIter->next) {
2649 rsc_colocation_t *constraint = (rsc_colocation_t *) gIter->data;
2650
2651 if (constraint->score > 0) {
2652 mode |= check_stack_element(rsc, constraint->rsc_rh, type);
2653 }
2654 }
2655 return mode;
2656
2657 } else if (other_p->variant == pe_group) {
2658 crm_notice("Cannot migrate %s due to dependency on group %s (%s)",
2659 rsc->id, other_rsc->id, type);
2660 return stack_middle;
2661
2662 }
2663
2664 /* else: >= clone */
2665 /*
2666
2667 ## Assumption
2668 A depends on clone(B)
2669
2670 ## Resource Activity During Move
2671
2672 N1 N2 N3
2673 --- --- ---
2674 t0 A.stop
2675 t1 B.stop B.stop
2676 t2 B.start B.start
2677 t3 A.start
2678
2679 ## Resource Activity During Migration
2680
2681 N1 N2 N3
2682 --- --- ---
2683 t0 B.start B.start
2684 t1 A.stop (1)
2685 t2 A.start (2)
2686 t3 B.stop B.stop
2687
2688 Node 1: Rewritten to be a migrate-to operation
2689 Node 2: Rewritten to be a migrate-from operation

Callers 2

at_stack_bottomFunction · 0.85
MigrateRscFunction · 0.85

Calls 2

uber_parentFunction · 0.85
find_clone_activity_onFunction · 0.85

Tested by

no test coverage detected