diff -r ad93b76a99c0 pengine/allocate.c --- a/pengine/allocate.c Mon Jul 26 15:42:35 2010 +0900 +++ b/pengine/allocate.c Mon Jul 26 15:56:29 2010 +0900 @@ -906,6 +906,72 @@ return FALSE; } +static gboolean +common_loglevel_down(resource_t *rsc, pe_working_set_t *data_set, gboolean *duplicate) +{ + GListPtr possible_matches = NULL; + gboolean ret = TRUE; + + if (rsc->children) { + slist_iter( + child_rsc, resource_t, rsc->children, lpc, + ret = common_loglevel_down(child_rsc, data_set, duplicate); + if (ret == FALSE) break; + ); + return ret; + } + + if (rsc->variant == pe_native && g_list_length(rsc->running_on) > 1) { + int effective_stonith = 0; + const char *class = crm_element_value(rsc->xml, XML_AGENT_ATTR_CLASS); + *duplicate = TRUE; + + if (safe_str_eq(class, "stonith")) { + slist_iter(running_node, node_t, rsc->running_on, lpc, + possible_matches = find_actions(data_set->actions, crm_strdup(CRM_OP_FENCE), running_node); + if (possible_matches == NULL) { + effective_stonith++; + crm_debug_3("Duplicate of an effective stonith resource appeared. ", + running_node->details->uname, effective_stonith ); + } else { + action_t *op = NULL; + op = g_list_nth_data(possible_matches, 0); + crm_debug_3("Duplicate of the stonith resource of a node done stonith of appeared. ", + op->node->details->uname, op->task); + g_list_free(possible_matches); + } + ); + if (effective_stonith != 1) { + ret = FALSE; + } + } else { + crm_debug_3("Duplicate except the stonith resource appeared. ", rsc->id); + ret = FALSE; + } + } + return ret; +} + +gboolean +common_loglevel_down_for_operator(pe_working_set_t *data_set){ + gboolean loglevel_down = TRUE; + gboolean duplicate = FALSE; + + crm_debug_3("Processing logleveldown [%s]", was_processing_error? "true":"false"); + if (was_processing_error) { + slist_iter( + rsc, resource_t, data_set->resources, lpc, + loglevel_down = common_loglevel_down(rsc, data_set, &duplicate); + if (loglevel_down == FALSE ) break; + ); + if (loglevel_down && was_processing_error && duplicate) { + crm_debug_3("Update : was_processing_error=FALSE"); + was_processing_error = FALSE; + } + } + return loglevel_down; +} + /* * Create dependancies for stonith and shutdown operations */ diff -r ad93b76a99c0 pengine/pengine.c --- a/pengine/pengine.c Mon Jul 26 15:42:35 2010 +0900 +++ b/pengine/pengine.c Mon Jul 26 15:56:29 2010 +0900 @@ -119,6 +119,8 @@ if(process) { do_calculations(&data_set, converted, NULL); + common_loglevel_down_for_operator(&data_set); + } series_id = get_series(); diff -r ad93b76a99c0 pengine/pengine.h --- a/pengine/pengine.h Mon Jul 26 15:42:35 2010 +0900 +++ b/pengine/pengine.h Mon Jul 26 15:56:29 2010 +0900 @@ -165,6 +165,8 @@ extern void graph_element_from_action( action_t *action, pe_working_set_t *data_set); +extern gboolean common_loglevel_down_for_operator(pe_working_set_t *data_set); + extern gboolean show_scores; extern int scores_log_level; extern const char* transition_idle_timeout;