Amanda-Users

Re: amanda-2.5.1p3 ignores no-reuse

2008-08-21 14:56:20
Subject: Re: amanda-2.5.1p3 ignores no-reuse
From: Jean-Louis Martineau <martineau AT zmanda DOT com>
To: Olivier Nicole <on AT cs.ait.ac DOT th>, Jon LaBadie <jon AT jgcomp DOT com>
Date: Thu, 21 Aug 2008 14:00:07 -0400
As Jon said, it's a problem with new tape marked as no-reuse, only the report is bad, amanda will works as expected.

The attached patch fix 'amadmin CONF tape' and amreport.
I don't know if the patch apply to 2.5.1p3.

Jean-Louis

Olivier Nicole wrote:
Hello,

I am setting up a new Amanda server.

Using virtual tapes on USB disk, it seems to be fast enough (20 to 40
MBps) depending on the hardware, the speed of the holding disks,
etc. Faster than the dump, so no problem.

I am currently hit by the IPv6 only problem on the client side, but
that one I identified and hope to solve it by reinstalling amanda for
IPv4 only.

The problem is the following:

I have 3 USB disks for virtual tapes, and only one is connected at a
given time, so in tapelist I marked the tapes that are not accessible
with no-reuse. They cannot be used because the disk is not online.

Despite, the report at the end of a dump mention that amanda will try
to use these;

  These dumps were to tape CSIM-set-1-06.
  The next 5 tapes Amanda expects to use are: 5 new tapes.
The next 5 new tapes already labelled are: CSIM-set-1-07, CSIM-set-1-08, CSIM-set-1-09, CSIM-set-2-01, CSIM-set-2-02.

The tapes CSIM-set-2-01, CSIM-set-2-02 are on a disk that is not
online and they are marked no-reuse:

  0 CSIM-set-2-02 no-reuse
  0 CSIM-set-2-01 no-reuse
  0 CSIM-set-1-09 reuse
  0 CSIM-set-1-08 reuse
  0 CSIM-set-1-07 reuse

Is that a feature?

Best regards,

Olivier

Index: amadmin.c
===================================================================
--- amadmin.c   (revision 12873)
+++ amadmin.c   (working copy)
@@ -805,16 +805,29 @@
            tp = lookup_last_reusable_tape(i + 1);
        }
     }
+
+    /* Find latest reusable new tape */
     lasttp = lookup_tapepos(lookup_nb_tape());
+    while (lasttp && lasttp->reuse == 0)
+       lasttp = lasttp->prev;
+
     i = runtapes;
     if(lasttp && i > 0 && strcmp(lasttp->datestamp,"0") == 0) {
        int c = 0;
+       /* find how many new tape are reusable */
        while(lasttp && i > 0 && strcmp(lasttp->datestamp,"0") == 0) {
-           c++;
+           if (lasttp->reuse) {
+               c++;
+               i--;
+           }
            lasttp = lasttp->prev;
-           i--;
        }
+
+       /* Find latest reusable new tape */
        lasttp = lookup_tapepos(lookup_nb_tape());
+       while (lasttp && lasttp->reuse == 0)
+           lasttp = lasttp->prev;
+
        i = runtapes;
        if(c == 1) {
            g_printf(_("The next new tape already labelled is: %s.\n"),
@@ -826,9 +839,11 @@
            lasttp = lasttp->prev;
            c--;
            while(lasttp && c > 0 && strcmp(lasttp->datestamp,"0") == 0) {
-               g_printf(", %s", lasttp->label);
+               if (lasttp->reuse) {
+                   g_printf(", %s", lasttp->label);
+                   c--;
+               }
                lasttp = lasttp->prev;
-               c--;
            }
            g_printf(".\n");
        }
Index: reporter.c
===================================================================
--- reporter.c  (revision 12873)
+++ reporter.c  (working copy)
@@ -1103,16 +1103,22 @@
     }
     fputs(".\n", mailf);
 
+    /* Find latest reusable new tape */
     lasttp = lookup_tapepos(lookup_nb_tape());
+    while (lasttp && lasttp->reuse == 0)
+       lasttp = lasttp->prev;
+
     run_tapes = getconf_int(CNF_RUNTAPES);
     if(lasttp && run_tapes > 0 && strcmp(lasttp->datestamp,"0") == 0) {
        int c = 0;
        iter = lasttp;
        /* count the number of tapes we *actually* used */
        while(iter && run_tapes > 0 && strcmp(iter->datestamp,"0") == 0) {
-           c++;
+           if (iter->reuse) {
+               c++;
+               run_tapes--;
+           }
            iter = iter->prev;
-           run_tapes--;
        }
        if(c == 1) {
            g_fprintf(mailf, _("The next new tape already labelled is: %s.\n"),
@@ -1124,9 +1130,11 @@
            iter = lasttp->prev;
            c--;
            while(iter && c > 0 && strcmp(iter->datestamp,"0") == 0) {
-               g_fprintf(mailf, ", %s", iter->label);
+               if (iter->reuse) {
+                   g_fprintf(mailf, ", %s", iter->label);
+                   c--;
+               }
                iter = iter->prev;
-               c--;
            }
            g_fprintf(mailf, ".\n");
        }
<Prev in Thread] Current Thread [Next in Thread>