Bacula-users

Re: [Bacula-users] tape use period counted from when use should have started instead of when it did

2008-04-15 07:09:00
Subject: Re: [Bacula-users] tape use period counted from when use should have started instead of when it did
From: Tilman Schmidt <t.schmidt AT phoenixsoftware DOT de>
To: bacula-users <bacula-users AT lists.sourceforge DOT net>
Date: Tue, 15 Apr 2008 13:08:49 +0200
Ryan Novosielski schrieb:
Arno Lehmann wrote:
11.04.2008 11:08, Tilman Schmidt wrote:
If a job has been waiting for a tape to be mounted for longer than the
tape's maximum use duration, once the tape is finally mounted it is
immediately marked as "Used" because of "Max configured use duration
exceeded." which is surprising because it hasn't actually been in use
at all. Apparently Bacula counts the volume's "use duration" from the
start of the job even if the volume hasn't been present during all that
time. I do not think that is sensible.

Difficult scenario... the behavior you observe is correct from Baculas point of view: Once the tape is reserved it counts as 'in use'. [...]

I'm really not certain that this behavior is the case at all. I don't
think it will do anything to the tape before it gets it[...].

Correct. What happens is that once it does get the tape, it sets the
FirstWritten attribute, not to the current time but to the time when it
requested the volume. As an example, this is the data of a volume that
was mounted on 2008-04-11 09:16 but the job had been waiting for it
since 2008-04-10 23:09:

*llist volumes pool=Daily
           MediaId: 19
        VolumeName: Donnerstag
              Slot: 0
            PoolId: 3
         MediaType: LTO1
      FirstWritten: 2008-04-10 23:09:24
       LastWritten: 2008-04-11 10:34:04
         LabelDate: 2008-04-10 23:09:24
           VolJobs: 10
          VolFiles: 13
         VolBlocks: 94,456
         VolMounts: 7
          VolBytes: 6,093,609,984
         VolErrors: 0
         VolWrites: 440,053
  VolCapacityBytes: 0
         VolStatus: Used
           Enabled: 1
           Recycle: 1
      VolRetention: 518,400
    VolUseDuration: 28,800
        MaxVolJobs: 0
       MaxVolFiles: 0
       MaxVolBytes: 0
         InChanger: 1
           EndFile: 12
          EndBlock: 3,437
          VolParts: 0
         LabelType: 0
         StorageId: 3
          DeviceId: 0
        LocationId: 0
      RecycleCount: 2
      InitialWrite: 0000-00-00 00:00:00
     ScratchPoolId: 0
     RecyclePoolId: 0
           Comment: NULL

Corresponding log entries:

10-Apr 23:05 vm-backup-dir JobId 527: Start Backup JobId 527, 
Job=vm-backup.2008-04-10_23.05.19
10-Apr 23:05 vm-backup-dir JobId 527: Max configured use duration exceeded. Marking 
Volume "Mittwoch" as Used.
10-Apr 23:05 vm-backup-dir JobId 527: There are no more Jobs associated with Volume 
"Dienstag". Marking it purged.
10-Apr 23:05 vm-backup-dir JobId 527: All records pruned from Volume "Dienstag"; marking 
it "Purged"
10-Apr 23:05 vm-backup-dir JobId 527: Recycled volume "Dienstag"
10-Apr 23:05 vm-backup-dir JobId 527: Using Device "LTO1"
10-Apr 23:05 vm-backup-fd JobId 527: ClientRunBeforeJob: run command "su - backup -c 
/home/backup/bin/collect-remote-backups"
10-Apr 23:07 vm-backup-fd JobId 527: ClientRunBeforeJob: tar: 
var/lib/mysql/mysql.sock: socket ignored
10-Apr 23:08 vm-backup-fd JobId 527: ClientRunBeforeJob: tar: 
var/spool/postfix/public/flush: socket ignored
10-Apr 23:08 vm-backup-fd JobId 527: ClientRunBeforeJob: tar: 
var/spool/postfix/public/showq: socket ignored
10-Apr 23:08 vm-backup-fd JobId 527: ClientRunBeforeJob: tar: 
var/spool/postfix/public/cleanup: socket ignored
10-Apr 23:09 vm-backup-sd JobId 527: Warning: Director wanted Volume "Dienstag".
    Current Volume "Donnerstag" not acceptable because:
    1998 Volume "Donnerstag" status is Used, but should be Append, Purged or 
Recycle.
10-Apr 23:09 vm-backup-sd JobId 527: Please mount Volume "Dienstag" or label a 
new one for:
    Job:          vm-backup.2008-04-10_23.05.19
    Storage:      "LTO1" (/dev/nst0)
    Pool:         Daily
    Media type:   LTO1
[repeated messages snipped]
11-Apr 09:15 vm-backup-sd JobId 527: Warning: Director wanted Volume "Dienstag".
    Current Volume "Donnerstag" not acceptable because:
    1998 Volume "Donnerstag" status is Used, but should be Append, Purged or 
Recycle.
11-Apr 09:15 vm-backup-sd JobId 527: Please mount Volume "Dienstag" or label a 
new one for:
    Job:          vm-backup.2008-04-10_23.05.19
    Storage:      "LTO1" (/dev/nst0)
    Pool:         Daily
    Media type:   LTO1
11-Apr 09:16 vm-backup-dir JobId 527: Recycled current volume "Donnerstag"
11-Apr 09:16 vm-backup-sd JobId 527: Recycled volume "Donnerstag" on device 
"LTO1" (/dev/nst0), all previous data lost.
11-Apr 09:16 vm-backup-dir JobId 527: Max configured use duration exceeded. Marking 
Volume "Donnerstag" as Used.

At 09:15 I came to the bconsole, saw that the backup hadn't run yet
because it insisted on a different tape (see other thread), entered
first "mount LTO1" hoping in vain to convince it to use the tape in the
drive, and then "prune volume" which succeeded in putting it into
"Recycled" state, but Bacula immediately promoted it to "Used" because
it considered the 8 hours maximum use time as already passed.

Interestingly enough, job 527 still wrote its data to that volume anyway.
Only the following jobs refused to append to the "Used" volume.

HTH
T.

--
Tilman Schmidt
Phoenix Software GmbH                               Tel. +49 228 97199 0
Adolf-Hombitzer-Str. 12                            Fax  +49 228 97199 99
53227 Bonn, Germany                               www.phoenixsoftware.de


Attachment: signature.asc
Description: OpenPGP digital signature

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users