Hello Dustin,

I've been re-bitten by the bug described below while doing an 'amrecover' with 
version 3.1.3

I used the same patch that you provided me for 3.1.1 on 3.1.3 and it fixed it.

My question is this:  Should this patch not be already included in '3.1.3' ???

Thanks!
----- Original Message -----
From: "Luc Lalonde" <[email protected]>
To: "Dustin J. Mitchell" <[email protected]>
Cc: [email protected]
Sent: Tuesday, August 10, 2010 2:39:19 PM GMT -05:00 US/Canada Eastern
Subject: Re: amidxtaped v3.1.1 bug (critical (fatal): Modification of 
non-creatable array value attempted)

Fantastic!  That did the trick.

Will you be including this in 3.1.2?  For the moment, I patched the RPMSRC from 
the Zmanda binary repo and it works great with your modifications.

Thank you very much!

----- Original Message -----
From: "Dustin J. Mitchell" <[email protected]>
To: "Luc Lalonde" <[email protected]>
Cc: [email protected]
Sent: Monday, August 9, 2010 5:53:55 PM GMT -05:00 US/Canada Eastern
Subject: Re: amidxtaped v3.1.1 bug (critical (fatal): Modification of  
non-creatable array value attempted)

Ok, I took a look at the logfiles, and they're *very* old-school.  It
looks like there's been a longstanding bug in find.c that mis-parsed
some of these log entries, and now that we're up and running with
Amanda::DB::Catalog, that mis-parsing causes failures.

I managed to reproduce this by excerpting and anonymizing a tiny bit
of a logfile.  This patch
  http://github.com/djmitche/amanda/commit/z11690.patch
passes my tests.  Can you let me know if it works for you?

Dustin

-- 
Open Source Storage Engineer
http://www.zmanda.com

-- 
Luc Lalonde, analyste
---------------------------------------------------------------------
Département de génie informatique:
École polytechnique de Montréal
(514) 340-4711 x5049
[email protected]
---------------------------------------------------------------------

-- 
Luc Lalonde, analyste
---------------------------------------------------------------------
Département de génie informatique:
École polytechnique de Montréal
(514) 340-4711 x5049
[email protected]
---------------------------------------------------------------------
>From 9b62c53f9157a536082a8c7188c547b1d9515b1e Mon Sep 17 00:00:00 2001
From: Dustin J. Mitchell <[email protected]>
Date: Mon, 9 Aug 2010 16:50:19 -0500
Subject: [PATCH] parse old-school 'SUCCESS taper' lines, getting partnum correct

---
 installcheck/Amanda_DB_Catalog.pl |   20 ++++++++++++++++++--
 perl/Amanda/DB/Catalog.pm         |    6 ++++--
 server-src/find.c                 |    4 +++-
 3 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/installcheck/Amanda_DB_Catalog.pl b/installcheck/Amanda_DB_Catalog.pl
index 91b3160..d29f4b7 100644
--- a/installcheck/Amanda_DB_Catalog.pl
+++ b/installcheck/Amanda_DB_Catalog.pl
@@ -208,10 +208,12 @@ Amanda::DB::Catalog::_clear_cache();
 # Test the timestamps
 
 is_deeply([ Amanda::DB::Catalog::get_write_timestamps(), ],
-    [ '20080111000000', '20080222222222', '20080313133333', '20080414144444', '20080515155555', '20080616166666' ],
+    [ '20080111000000', '20080222222222', '20080313133333',
+      '20080414144444', '20080515155555', '20080616166666',
+      '20100722000000' ],
     "get_write_timestamps returns all logfile datestamps in proper order, with zero-padding");
 
-is(Amanda::DB::Catalog::get_latest_write_timestamp(), '20080616166666',
+is(Amanda::DB::Catalog::get_latest_write_timestamp(), '20100722000000',
     "get_latest_write_timestamp correctly returns the latest write timestamp");
 
 ##
@@ -1038,3 +1040,17 @@ START taper datestamp 20080616166666 label Conf-008 tape 1
 #:part somebox_lib_20080616166666 somebox_lib_20080616166666 Conf-008 1 1 OK 0.000370 20 20
 PART taper Conf-008 1 somebox /lib 20080616166666 2/2 1 [sec 0.000370 kb 20 kps 54054.054054 orig-kb 20]
 DONE taper somebox /lib 20080616166666 1 1 [sec 0.000370 kb 20 kps 54054.054054 orig-kb 20]
+
+# an old-school logfile
+::: log.20100722.0
+:timestamp 20100722000000
+:tapelist 20100722 Conf-009
+DISK planner lovelace /home/ada
+START taper datestamp 20100722 label Conf-009 tape 0
+SUCCESS dumper lovelace /home/ada 20100722 3 [sec 19.271 kb 166951 kps 8663.1 orig-kb 208420]
+SUCCESS chunker lovelace /home/ada 20100722 3 [sec 19.298 kb 166951 kps 8652.7]
+STATS driver estimate lovelace /home/ada 20100722 3 [sec 30 nkb 208422 ckb 32640 kps 1081]
+:dump lovelace_home_ada_20100722 20100722000000 lovelace /home/ada 3 OK "" 1 0.883 166976 0
+:part lovelace_home_ada_20100722 lovelace_home_ada_20100722 Conf-009 1 1 OK 0.883 166976 0
+SUCCESS taper lovelace /home/ada 20100722 3 [sec 0.883 kb 166976 kps 188922.8 {wr: writers 5219 rdwait 0.001 wrwait 0.710 filemark 0.000}]
+INFO taper tape Conf-009 kb 166976 fm 1 [OK]
diff --git a/perl/Amanda/DB/Catalog.pm b/perl/Amanda/DB/Catalog.pm
index c73855e..2879240 100644
--- a/perl/Amanda/DB/Catalog.pm
+++ b/perl/Amanda/DB/Catalog.pm
@@ -656,6 +656,8 @@ sub get_parts_and_dumps {
 		$status = 'PARTIAL';
 	    } elsif ($type == $L_FAIL) {
 		$status = 'FAIL';
+	    } elsif ($type == $L_SUCCESS) {
+		$status = "OK";
 	    } else {
 		next;
 	    }
@@ -666,7 +668,7 @@ sub get_parts_and_dumps {
 	    ($hostname, $str) = Amanda::Util::skip_quoted_string($str);
 	    ($diskname, $str) = Amanda::Util::skip_quoted_string($str);
 	    ($dump_timestamp, $str) = Amanda::Util::skip_quoted_string($str);
-	    if ($status ne 'FAIL') {
+	    if ($status ne 'FAIL' and $type != $L_SUCCESS) { # nparts is not in SUCCESS lines
 		($nparts, $str) = Amanda::Util::skip_quoted_string($str);
 	    } else {
 		$nparts = 0;
@@ -674,7 +676,7 @@ sub get_parts_and_dumps {
 	    ($level, $str) = Amanda::Util::skip_quoted_string($str);
 	    if ($status ne 'FAIL') {
 		my $s = $str;
-		($secs, $kb, $str) = ($str =~ /^\[sec ([0-9.]+) kb (\d+) .*\] ?(.*)$/)
+		($secs, $kb, $str) = ($str =~ /^\[sec ([0-9.]+) kb (\d+).*\] ?(.*)$/)
 		    or die("'$s'");
 	    }
 	    if ($status ne 'OK') {
diff --git a/server-src/find.c b/server-src/find.c
index bda5912..29d14de 100644
--- a/server-src/find.c
+++ b/server-src/find.c
@@ -916,8 +916,9 @@ search_logfile(
 		amfree(str);
 	    } else {
 		bzero(&regex, sizeof(regex));
+		/* the .* at the end of this captures the old {wr: .. } statistics */
 		reg_result = regcomp(&regex,
-		    "\\[sec ([0-9.]+) kb ([0-9]+) kps [0-9.]+\\]", REG_EXTENDED);
+		    "\\[sec ([0-9.]+) kb ([0-9]+) kps [0-9.]+.*\\]", REG_EXTENDED);
 		if (reg_result != 0) {
 		    error("Error compiling regular expression for parsing log lines");
 		    /* NOTREACHED */
@@ -977,6 +978,7 @@ search_logfile(
 			new_output_find->status = stralloc("OK");
 			new_output_find->dump_status = stralloc("OK");
 			new_output_find->next = *output_find;
+			new_output_find->partnum = 1; /* L_SUCCESS is pre-splitting */
 			*output_find = new_output_find;
                         found_something = TRUE;
 		    } else if (curlog == L_CHUNKSUCCESS || curlog == L_DONE ||
-- 
1.7.0.2

Reply via email to