On 4/3/06, [email protected]
<[email protected]> wrote:
> linux-ha CVS committal
>
> Author : andrew
> Host :
> Project : linux-ha
> Module : crm
>
> Dir : linux-ha/crm/pengine
>
>
> Modified Files:
> Makefile.am pengine.c stages.c
>
>
> Log Message:
> Instead of logging the partial inputs to the PE, compress and write them
> to HA_VARLIBDIR"/heartbeat/pengine"
> Inputs are stored in one of 3 series "errors", "warnings" and "other"
> depending
> on what happened during the calculations.
> For now it stores all of them and keeps a ".last" file for each series so
> that older entries are not overwritten. Shortly there will be an option
> to determin how many to keep from each series before overwriting the oldest
> ones.
>
For people doing CTS testing and submitting CRM bugs, this means that
you need to include more than just the log files.
After extracting the log files, you should grep for this pattern
"Input stored in:" and attach the files mentioned. Alternatively, tar
up the entire HA_VARLIBDIR"/heartbeat/pengine" directory on each
machine and either have it available or attach it to the bugzilla
entry.
> ===================================================================
> RCS file: /home/cvs/linux-ha/linux-ha/crm/pengine/Makefile.am,v
> retrieving revision 1.32
> retrieving revision 1.33
> diff -u -3 -r1.32 -r1.33
> --- Makefile.am 20 Feb 2006 17:22:42 -0000 1.32
> +++ Makefile.am 3 Apr 2006 09:51:56 -0000 1.33
> @@ -28,6 +28,7 @@
> halibdir = $(libdir)/@HB_PKG@
> commmoddir = $(halibdir)/modules/comm
> havarlibdir = $(localstatedir)/lib/@HB_PKG@
> +pe_varlibdir = $(HA_VARLIBDIR)/$(HB_PKG)/pengine
>
> # sockets with path
> crmdir = $(havarlibdir)/crm
> @@ -86,5 +87,9 @@
> rm -f *.log *.debug *~
>
> install-exec-local:
> + $(mkinstalldirs) $(DESTDIR)/$(pe_varlibdir)
> + -chown $(HA_CCMUSER) $(DESTDIR)/$(pe_varlibdir)
> + -chgrp $(HA_APIGROUP) $(DESTDIR)/$(pe_varlibdir)
> + -chmod 750 $(DESTDIR)/$(pe_varlibdir)
>
> uninstall-local:
> ===================================================================
> RCS file: /home/cvs/linux-ha/linux-ha/crm/pengine/pengine.c,v
> retrieving revision 1.105
> retrieving revision 1.106
> diff -u -3 -r1.105 -r1.106
> --- pengine.c 9 Mar 2006 21:36:38 -0000 1.105
> +++ pengine.c 3 Apr 2006 09:51:56 -0000 1.106
> @@ -1,4 +1,4 @@
> -/* $Id: pengine.c,v 1.105 2006/03/09 21:36:38 andrew Exp $ */
> +/* $Id: pengine.c,v 1.106 2006/04/03 09:51:56 andrew Exp $ */
> /*
> * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
> *
> @@ -41,9 +41,18 @@
> gboolean was_config_warning = FALSE;
> unsigned int pengine_input_loglevel = LOG_INFO;
>
> +#define PE_WORKING_DIR HA_VARLIBDIR"/heartbeat/pengine"
> +
> +
> +extern int transition_id;
> +
> +#define get_series()
> was_processing_error?"pe-error":was_processing_warning?"pe-warn":"pe-input"
> +
> gboolean
> process_pe_message(HA_Message *msg, crm_data_t * xml_data, IPC_Channel
> *sender)
> {
> + int seq = -1;
> + const char *use_series = NULL;
> const char *sys_to = cl_get_string(msg, F_CRM_SYS_TO);
> const char *op = cl_get_string(msg, F_CRM_TASK);
> const char *ref = cl_get_string(msg, XML_ATTR_REFERENCE);
> @@ -68,42 +77,21 @@
> pe_working_set_t data_set;
> crm_data_t *generation = create_xml_node(NULL, XML_TAG_CIB);
> crm_data_t *log_input = copy_xml(xml_data);
> - crm_data_t *status = get_object_root(
> - XML_CIB_TAG_STATUS, log_input);
> -
> + char *filename = NULL;
> +#if HAVE_BZLIB_H
> + gboolean compress = TRUE;
> +#else
> + gboolean compress = FALSE;
> +#endif
> +
> copy_in_properties(generation, xml_data);
> crm_log_xml_info(generation, "[generation]");
> -
> -#if 0
> - char *xml_buffer = NULL;
> - char *xml_buffer_ptr = NULL;
> - int max_xml = MAXLINE - 8;
> -
> - xml_buffer = dump_xml_unformatted(generation);
> - LogToCircularBuffer(input_buffer, LOG_INFO,
> - "Generation: %s", xml_buffer);
> - crm_free(xml_buffer);
> -
> - xml_buffer = dump_xml_unformatted(status);
> - xml_buffer_ptr = xml_buffer;
> -
> - while(xml_buffer_ptr != NULL) {
> - LogToCircularBuffer(input_buffer, LOG_INFO,
> - "PE xml: %s", xml_buffer_ptr);
> - if(strlen(xml_buffer_ptr) > max_xml) {
> - xml_buffer_ptr = xml_buffer_ptr + max_xml;
> - } else {
> - xml_buffer_ptr = NULL;;
> - }
> - }
> - crm_free(xml_buffer);
> -#endif
> +
> was_processing_error = FALSE;
> was_processing_warning = FALSE;
>
> crm_zero_mem_stats(NULL);
>
> -
> do_calculations(&data_set, xml_data, NULL);
> crm_log_xml_debug_3(data_set.graph, "[out]");
>
> @@ -117,25 +105,30 @@
> if(is_ipc_empty(sender) && crm_mem_stats(NULL)) {
> pe_warn("Unfree'd memory");
> }
> +
> + use_series = get_series();
> +
> + seq = get_last_sequence(PE_WORKING_DIR, use_series);
>
> + filename = generate_series_filename(
> + PE_WORKING_DIR, use_series, seq, compress);
> + write_xml_file(log_input, filename, compress);
> + write_last_sequence(PE_WORKING_DIR, use_series, seq+1, -1);
> +
> if(was_processing_error) {
> - crm_info("ERRORs found during PE processing."
> - " Input follows:");
> - crm_log_xml(
> - pengine_input_loglevel-2, "[input]",
> log_input);
> + crm_err("Transition %d:"
> + " ERRORs found during PE processing."
> + " Input stored in: %s",
> + transition_id, filename);
>
> } else if(was_processing_warning) {
> - crm_log_maybe(pengine_input_loglevel-1,
> - "WARNINGs found during PE processing."
> - " Input follows:");
> - crm_log_xml(
> - pengine_input_loglevel-1,"[input]",
> log_input);
> -
> - } else if (crm_log_level > pengine_input_loglevel) {
> - crm_log_xml(
> - pengine_input_loglevel+1, "[input]",
> log_input);
> + crm_warn("Transition %d:"
> + " WARNINGs found during PE processing."
> + " Input stored in: %s",
> + transition_id, filename);
> +
> } else {
> - crm_log_xml(pengine_input_loglevel, "[status]",
> status);
> + crm_info("PEngine input stored in: %s", filename);
> }
>
> if(was_config_error) {
> @@ -146,9 +139,10 @@
> crm_info("Configuration WARNINGs found during PE
> processing."
> " Please run \"crm_verify -L\" to identify
> issues.");
> }
> -
> +
> free_xml(generation);
> free_xml(log_input);
> + crm_free(filename);
>
> } else if(strcmp(op, CRM_OP_QUIT) == 0) {
> crm_warn("Received quit message, terminating");
> ===================================================================
> RCS file: /home/cvs/linux-ha/linux-ha/crm/pengine/stages.c,v
> retrieving revision 1.89
> retrieving revision 1.90
> diff -u -3 -r1.89 -r1.90
> --- stages.c 21 Mar 2006 17:56:36 -0000 1.89
> +++ stages.c 3 Apr 2006 09:51:56 -0000 1.90
> @@ -1,4 +1,4 @@
> -/* $Id: stages.c,v 1.89 2006/03/21 17:56:36 andrew Exp $ */
> +/* $Id: stages.c,v 1.90 2006/04/03 09:51:56 andrew Exp $ */
> /*
> * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
> *
> @@ -451,7 +451,7 @@
> return TRUE;
> }
>
> -static int transition_id = -1;
> +int transition_id = -1;
> /*
> * Create a dependency graph to send to the transitioner (via the CRMd)
> */
>
>
> _______________________________________________
> Linux-ha-cvs mailing list
> [email protected]
> http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs
>
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/