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

Function stage2

pengine/allocate.c:903–939  ·  view source on GitHub ↗

* Count how many valid nodes we have (so we know the maximum number of * colors we can resolve). * * Apply node constraints (ie. filter the "allowed_nodes" part of resources */

Source from the content-addressed store, hash-verified

901 * Apply node constraints (ie. filter the "allowed_nodes" part of resources
902 */
903gboolean
904stage2(pe_working_set_t * data_set)
905{
906 GListPtr gIter = NULL;
907
908 crm_trace("Applying placement constraints");
909
910 gIter = data_set->nodes;
911 for (; gIter != NULL; gIter = gIter->next) {
912 node_t *node = (node_t *) gIter->data;
913
914 if (node == NULL) {
915 /* error */
916
917 } else if (node->weight >= 0.0 /* global weight */
918 && node->details->online && node->details->type == node_member) {
919 data_set->max_valid_nodes++;
920 }
921 }
922
923 apply_placement_constraints(data_set);
924
925 gIter = data_set->nodes;
926 for (; gIter != NULL; gIter = gIter->next) {
927 GListPtr gIter2 = NULL;
928 node_t *node = (node_t *) gIter->data;
929
930 gIter2 = data_set->resources;
931 for (; gIter2 != NULL; gIter2 = gIter2->next) {
932 resource_t *rsc = (resource_t *) gIter2->data;
933
934 common_apply_stickiness(rsc, node, data_set);
935 }
936 }
937
938 return TRUE;
939}
940
941/*
942 * Create internal resource constraints before allocation

Callers 1

do_calculationsFunction · 0.85

Calls 2

common_apply_stickinessFunction · 0.85

Tested by

no test coverage detected