Amanda-Users

Re: amanda-2.6.0p2: a few remarks and questions

2008-11-11 20:49:57
Subject: Re: amanda-2.6.0p2: a few remarks and questions
From: Jean-Louis Martineau <martineau AT zmanda DOT com>
To: Jean-Francois Malouin <Jean-Francois.Malouin AT bic.mni.mcgill DOT ca>
Date: Tue, 11 Nov 2008 19:52:07 -0500
Hi Jean-François,

Can you try the attached patch?

Jean-Louis

Jean-Francois Malouin wrote:
Hello,

I've finally got to install amanda-2.6.0p2 on a system going soon into
production and while getting used to the new features and I noticed a
few things that have changed since 2.5.x :

- I use amtoc after a dump ends to get stats on what was written on
tape and noticed that it doesn't parse correctly the log files and the
toc files end up not showing what was written on tape. Looking at the
source I believe that this is due to the fact that amtoc doesn't parse
lines that start with 'PART' as the new log format seems to use
compared to 'CHUNK' in pre-2.6.x.

- amstatus doesn't show which tape(s) is being used and how much data
been written to it so far, a useful feature when I want to check that
a flush is being done correctly when using a changer with 'runtapes>1'

- As I posted a few days ago, amreport doesn't report correctly the
aggragated transfer rate to tape beyond 99.99MiBs...

- The new version features 'device_output_buffer_size' that replaces
'tapebufs'. Any hint on a ballpark figure for this? Right now I have
set it to 8192k (I use a blocksize=2048k) but I really don't know if I
overshooting with this...the server has 32GB of memory btw.

Thank you for the amazing work you guys are doing!
jf

Index: server-src/amstatus.pl
===================================================================
--- server-src/amstatus.pl      (revision 14148)
+++ server-src/amstatus.pl      (working copy)
@@ -722,6 +722,16 @@
                        $ntsize{$nb_tape} = 0;
                        $ntesize{$nb_tape} = 0;
                }
+               elsif($line[1] eq "using") {
+                       #1:"using" #2:"label" #3:`label' #4:date #5 `timestamp'
+                       $nb_tape++;
+                       $lineX =~ /using label `(\S*)'/;
+                       $label = $1;
+                       $ntlabel{$nb_tape} = $label;
+                       $ntpartition{$nb_tape} = 0;
+                       $ntsize{$nb_tape} = 0;
+                       $ntesize{$nb_tape} = 0;
+               }
        }
    elsif($line[0] eq "splitting" &&
                         $line[1] eq "chunk" &&
Index: server-src/driver.c
===================================================================
--- server-src/driver.c (revision 14148)
+++ server-src/driver.c (working copy)
@@ -303,6 +303,7 @@
     conf_runtapes = getconf_int(CNF_RUNTAPES);
     tape = lookup_tapetype(conf_tapetype);
     tape_length = tapetype_get_length(tape);
+    g_printf("driver: tape size %lld\n", (long long)tape_length);
     conf_flush_threshold_dumped = getconf_int(CNF_FLUSH_THRESHOLD_DUMPED);
     conf_flush_threshold_scheduled = 
getconf_int(CNF_FLUSH_THRESHOLD_SCHEDULED);
     conf_taperflush = getconf_int(CNF_TAPERFLUSH);
Index: server-src/amtoc.pl
===================================================================
--- server-src/amtoc.pl (revision 14148)
+++ server-src/amtoc.pl (working copy)
@@ -162,11 +162,26 @@
   }
   if ( ! /^([A-Z]+) taper (\S+) (\S+) (\S+) (\S+) (\S+)/) { next;}
   # $_ = $1;
-  $host = $2;
-  $disk = $3;
-  $date = $4;
-  $chunk = $5;
-  $level = $6;
+  if (/PART taper/) {
+    /^([A-Z]+) taper (\S+) (\S+) (\S+) (\S+) (\S+) (\S+) (\S+)/;
+    $filenum = $3;
+    $host = $4;
+    $disk = $5;
+    $date = $6;
+    $chunk = $7;
+    $level = $8;
+    if ($filenum != $filenumber) {
+      # This should not be possible */
+      $filenumber = $filenum;
+    }
+  } else {
+    /^([A-Z]+) taper (\S+) (\S+) (\S+) (\S+) (\S+)/;
+    $host = $2;
+    $disk = $3;
+    $date = $4;
+    $chunk = $5;
+    $level = $6;
+  }
   switch: {
     /START taper/ && do {
       $tocfilename=&tfn($chunk) if ($#subs >= 0);
@@ -191,7 +206,7 @@
       &pr("#","Server","/partition","date", "level","size[Kb]","part");
       &pr("$filenumber","$chunk","","$disk","-","-","-");
       last switch; };
-    /^(?:SUCCESS|CHUNK) taper/ && do {
+    /^(?:SUCCESS|CHUNK|PART) taper/ && do {
       if(/SUCCESS/){
        $level = $chunk;
        $chunk = "-";
@@ -239,6 +254,9 @@
       }
       last switch; };
     /FAIL taper/ && do { next; };
+    /DONE taper/ && do {
+      $filenumber -= 1;
+      last switch; };
   }
   $filenumber += 1;
 }
Index: server-src/reporter.c
===================================================================
--- server-src/reporter.c       (revision 14148)
+++ server-src/reporter.c       (working copy)
@@ -826,20 +826,24 @@
        double q = (b);                     \
        if (!isnormal(q))                   \
            g_fprintf((fp),"  -- ");        \
-       else if ((q = (a)/q) >= 999.95)     \
-           g_fprintf((fp), "###.#");       \
+       else if ((q = (a)/q) >= 99999.95)   \
+           g_fprintf((fp), "#####");       \
+       else if (q >= 999.95)               \
+           g_fprintf((fp), "%5.0lf",q);    \
        else                                \
-           g_fprintf((fp), "%5.1lf",q);            \
+           g_fprintf((fp), "%5.1lf",q);    \
     } while(0)
 #define divzero_wide(fp,a,b)               \
     do {                                           \
        double q = (b);                     \
        if (!isnormal(q))                   \
            g_fprintf((fp),"    -- ");      \
-       else if ((q = (a)/q) >= 99999.95)   \
-           g_fprintf((fp), "#####.#");     \
+       else if ((q = (a)/q) >= 9999999.95) \
+           g_fprintf((fp), "#######");     \
+       else if (q >= 99999.95)             \
+           g_fprintf((fp), "%7.0lf",q);    \
        else                                \
-           g_fprintf((fp), "%7.1lf",q);            \
+           g_fprintf((fp), "%7.1lf",q);    \
     } while(0)
 
 static void
<Prev in Thread] Current Thread [Next in Thread>