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

Function do_calculations

pengine/pengine.c:203–274  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

201}
202
203xmlNode *
204do_calculations(pe_working_set_t * data_set, xmlNode * xml_input, crm_time_t * now)
205{
206 GListPtr gIter = NULL;
207 int rsc_log_level = LOG_INFO;
208
209/* pe_debug_on(); */
210
211 CRM_ASSERT(xml_input || is_set(data_set->flags, pe_flag_have_status));
212
213 if (is_set(data_set->flags, pe_flag_have_status) == FALSE) {
214 set_working_set_defaults(data_set);
215 data_set->input = xml_input;
216 data_set->now = now;
217 if (data_set->now == NULL) {
218 data_set->now = crm_time_new(NULL);
219 }
220 } else {
221 crm_trace("Already have status - reusing");
222 }
223
224 crm_trace("Calculate cluster status");
225 stage0(data_set);
226
227 gIter = data_set->resources;
228 for (; gIter != NULL; gIter = gIter->next) {
229 resource_t *rsc = (resource_t *) gIter->data;
230
231 if (is_set(rsc->flags, pe_rsc_orphan) && rsc->role == RSC_ROLE_STOPPED) {
232 continue;
233 }
234 rsc->fns->print(rsc, NULL, pe_print_log, &rsc_log_level);
235 }
236
237 crm_trace("Applying placement constraints");
238 stage2(data_set);
239
240 crm_trace("Create internal constraints");
241 stage3(data_set);
242
243 crm_trace("Check actions");
244 stage4(data_set);
245
246 crm_trace("Allocate resources");
247 stage5(data_set);
248
249 crm_trace("Processing fencing and shutdown cases");
250 stage6(data_set);
251
252 crm_trace("Applying ordering constraints");
253 stage7(data_set);
254
255 crm_trace("Create transition graph");
256 stage8(data_set);
257
258 crm_trace("=#=#=#=#= Summary =#=#=#=#=");
259 crm_trace("\t========= Set %d (Un-runnable) =========", -1);
260 if (get_crm_log_level() >= LOG_TRACE) {

Callers 5

mainFunction · 0.85
profile_oneFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
process_pe_messageFunction · 0.85

Calls 13

is_setFunction · 0.85
set_working_set_defaultsFunction · 0.85
crm_time_newFunction · 0.85
stage0Function · 0.85
stage2Function · 0.85
stage3Function · 0.85
stage4Function · 0.85
stage5Function · 0.85
stage6Function · 0.85
stage7Function · 0.85
stage8Function · 0.85
get_crm_log_levelFunction · 0.85

Tested by 1

mainFunction · 0.68