Send Linux-ha-cvs mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs
or, via email, send a message with subject or body 'help' to
        [EMAIL PROTECTED]

You can reach the person managing the list at
        [EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Linux-ha-cvs digest..."


Today's Topics:

   1. Linux-HA CVS: include by andrew from 
      ([email protected])
   2. Linux-HA CVS: linux-ha by andrew from 
      ([email protected])
   3. Linux-HA CVS: crm by andrew from 
      ([email protected])


----------------------------------------------------------------------

Message: 1
Date: Mon,  3 Apr 2006 03:51:57 -0600 (MDT)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: include by andrew from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : andrew
Host    : 
Project : linux-ha
Module  : include

Dir     : linux-ha/include/crm/common


Modified Files:
        util.h 


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.

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/include/crm/common/util.h,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -3 -r1.30 -r1.31
--- util.h      31 Mar 2006 12:07:20 -0000      1.30
+++ util.h      3 Apr 2006 09:51:56 -0000       1.31
@@ -1,4 +1,4 @@
-/* $Id: util.h,v 1.30 2006/03/31 12:07:20 andrew Exp $ */
+/* $Id: util.h,v 1.31 2006/04/03 09:51:56 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -124,4 +124,12 @@
 extern void crm_abort(const char *file, const char *function, int line,
                      const char *condition, gboolean do_fork);
 
+extern char *generate_series_filename(
+       const char *directory, const char *series, int sequence, gboolean bzip);
+
+extern int get_last_sequence(const char *directory, const char *series);
+
+extern void write_last_sequence(
+       const char *directory, const char *series, int sequence, int max);
+
 #endif




------------------------------

Message: 2
Date: Mon,  3 Apr 2006 03:51:56 -0600 (MDT)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: linux-ha by andrew from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : andrew
Host    : 
Module  : linux-ha

Dir     : linux-ha


Modified Files:
        heartbeat.spec.in 


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.

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/heartbeat.spec.in,v
retrieving revision 1.165
retrieving revision 1.166
diff -u -3 -r1.165 -r1.166
--- heartbeat.spec.in   24 Mar 2006 08:16:45 -0000      1.165
+++ heartbeat.spec.in   3 Apr 2006 09:51:56 -0000       1.166
@@ -1,4 +1,4 @@
-#      $Id: heartbeat.spec.in,v 1.165 2006/03/24 08:16:45 zhenh Exp $
+#      $Id: heartbeat.spec.in,v 1.166 2006/04/03 09:51:56 andrew Exp $
 
 # Workaround for a change in RPM 4.1.x; needs proper fixing soon!
 ##%define _unpackaged_files_terminate_build 0
@@ -1170,6 +1170,7 @@
 %dir %attr (755, @HA_CCMUSER@, @HA_APIGROUP@) @HA_VARRUNDIR@/@HB_PKG@/ccm
 %dir %attr (750, @HA_CCMUSER@, @HA_APIGROUP@) @HA_VARRUNDIR@/@HB_PKG@/crm
 %dir %attr (750, @HA_CCMUSER@, @HA_APIGROUP@) @localstatedir@/lib/@HB_PKG@/crm
+%dir %attr (750, @HA_CCMUSER@, @HA_APIGROUP@) 
@localstatedir@/lib/@HB_PKG@/pengine
 %doc @mandir@/man1/cl_status.1*
 %doc @mandir@/man1/ha_logger.1*
 %doc @mandir@/man1/hb_standby.1*




------------------------------

Message: 3
Date: Mon,  3 Apr 2006 03:51:57 -0600 (MDT)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: crm by andrew from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

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.

===================================================================
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


End of Linux-ha-cvs Digest, Vol 29, Issue 4
*******************************************

Reply via email to