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

Function master_internal_constraints

pengine/master.c:867–913  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

865}
866
867void
868master_internal_constraints(resource_t * rsc, pe_working_set_t * data_set)
869{
870 GListPtr gIter = rsc->children;
871 resource_t *last_rsc = NULL;
872 clone_variant_data_t *clone_data = NULL;
873
874 get_clone_variant_data(clone_data, rsc);
875
876 clone_internal_constraints(rsc, data_set);
877
878 /* global stopped before start */
879 new_rsc_order(rsc, RSC_STOPPED, rsc, RSC_START, pe_order_optional, data_set);
880
881 /* global stopped before promote */
882 new_rsc_order(rsc, RSC_STOPPED, rsc, RSC_PROMOTE, pe_order_optional, data_set);
883
884 /* global demoted before start */
885 new_rsc_order(rsc, RSC_DEMOTED, rsc, RSC_START, pe_order_optional, data_set);
886
887 /* global started before promote */
888 new_rsc_order(rsc, RSC_STARTED, rsc, RSC_PROMOTE, pe_order_optional, data_set);
889
890 /* global demoted before stop */
891 new_rsc_order(rsc, RSC_DEMOTED, rsc, RSC_STOP, pe_order_optional, data_set);
892
893 /* global demote before demoted */
894 new_rsc_order(rsc, RSC_DEMOTE, rsc, RSC_DEMOTED, pe_order_optional, data_set);
895
896 /* global demoted before promote */
897 new_rsc_order(rsc, RSC_DEMOTED, rsc, RSC_PROMOTE, pe_order_optional, data_set);
898
899 for (; gIter != NULL; gIter = gIter->next) {
900 resource_t *child_rsc = (resource_t *) gIter->data;
901
902 /* child demote before promote */
903 new_rsc_order(child_rsc, RSC_DEMOTE, child_rsc, RSC_PROMOTE, pe_order_optional, data_set);
904
905 child_promoting_constraints(clone_data, pe_order_optional,
906 rsc, child_rsc, last_rsc, data_set);
907
908 child_demoting_constraints(clone_data, pe_order_optional,
909 rsc, child_rsc, last_rsc, data_set);
910
911 last_rsc = child_rsc;
912 }
913}
914
915static void
916node_hash_update_one(GHashTable * hash, node_t * other, const char *attr, int score)

Callers

nothing calls this directly

Calls 4

new_rsc_orderFunction · 0.85

Tested by

no test coverage detected