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

Function stage5

pengine/allocate.c:1099–1190  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1097}
1098
1099gboolean
1100stage5(pe_working_set_t * data_set)
1101{
1102 GListPtr gIter = NULL;
1103
1104 if (safe_str_neq(data_set->placement_strategy, "default")) {
1105 GListPtr nodes = g_list_copy(data_set->nodes);
1106
1107 nodes = g_list_sort_with_data(nodes, sort_node_weight, NULL);
1108
1109 data_set->resources =
1110 g_list_sort_with_data(data_set->resources, sort_rsc_process_order, nodes);
1111
1112 g_list_free(nodes);
1113 }
1114
1115 gIter = data_set->nodes;
1116 for (; gIter != NULL; gIter = gIter->next) {
1117 node_t *node = (node_t *) gIter->data;
1118
1119 dump_node_capacity(show_utilization ? 0 : utilization_log_level, "Original", node);
1120 }
1121
1122 crm_trace("Allocating services");
1123 /* Take (next) highest resource, assign it and create its actions */
1124
1125 gIter = data_set->resources;
1126 for (; gIter != NULL; gIter = gIter->next) {
1127 resource_t *rsc = (resource_t *) gIter->data;
1128
1129 pe_rsc_trace(rsc, "Allocating: %s", rsc->id);
1130 rsc->cmds->allocate(rsc, NULL, data_set);
1131 }
1132
1133 gIter = data_set->nodes;
1134 for (; gIter != NULL; gIter = gIter->next) {
1135 node_t *node = (node_t *) gIter->data;
1136
1137 dump_node_capacity(show_utilization ? 0 : utilization_log_level, "Remaining", node);
1138 }
1139
1140 if (is_set(data_set->flags, pe_flag_startup_probes)) {
1141 crm_trace("Calculating needed probes");
1142 /* This code probably needs optimization
1143 * ptest -x with 100 nodes, 100 clones and clone-max=100:
1144
1145 With probes:
1146
1147 ptest[14781]: 2010/09/27_17:56:46 notice: TRACE: do_calculations: pengine.c:258 Calculate cluster status
1148 ptest[14781]: 2010/09/27_17:56:46 notice: TRACE: do_calculations: pengine.c:278 Applying placement constraints
1149 ptest[14781]: 2010/09/27_17:56:47 notice: TRACE: do_calculations: pengine.c:285 Create internal constraints
1150 ptest[14781]: 2010/09/27_17:56:47 notice: TRACE: do_calculations: pengine.c:292 Check actions
1151 ptest[14781]: 2010/09/27_17:56:48 notice: TRACE: do_calculations: pengine.c:299 Allocate resources
1152 ptest[14781]: 2010/09/27_17:56:48 notice: TRACE: stage5: allocate.c:881 Allocating services
1153 ptest[14781]: 2010/09/27_17:56:49 notice: TRACE: stage5: allocate.c:894 Calculating needed probes
1154 ptest[14781]: 2010/09/27_17:56:51 notice: TRACE: stage5: allocate.c:899 Creating actions
1155 ptest[14781]: 2010/09/27_17:56:52 notice: TRACE: stage5: allocate.c:905 Creating done
1156 ptest[14781]: 2010/09/27_17:56:52 notice: TRACE: do_calculations: pengine.c:306 Processing fencing and shutdown cases

Callers 1

do_calculationsFunction · 0.85

Calls 4

safe_str_neqFunction · 0.85
dump_node_capacityFunction · 0.85
is_setFunction · 0.85
probe_resourcesFunction · 0.85

Tested by

no test coverage detected