Bacula-users

Re: [Bacula-users] Recycling problem.

2014-10-17 14:34:33
Subject: Re: [Bacula-users] Recycling problem.
From: Josh Fisher <jfisher AT pvct DOT com>
To: bacula-users AT lists.sourceforge DOT net
Date: Fri, 17 Oct 2014 14:31:36 -0400
On 10/17/2014 12:29 PM, Giuseppe Vitillaro wrote:

On Friday 17 October 2014 12:05:35 Ana Emília M. Arruda wrote:

> Hi Giuseppe,

>

> I would like to append some comments here about your "volume use duration"

> configuration. As the directive name says, this is used to leave the volume

> available for Bacula "during" your backup jobs (at least the ones you want

> the data goes to that volume). Maybe you are having volume retention time

> troubleshooting here. If Bacula is using 000529L4 instead of 000506L4, this

> is because both volumes have a status (purged, append, recycle) that

> permits bacula to choose which one is the best one (guided by its volume

> recycling algorithm). So, it seems the 000529L4 has a last written time

> older than the 000506L4.

>

> I recommend you to put your "volume use duration" in hours, like Josh

> Fisher said, and just the time that you need the volume be available

> (append) for receiving data. And take a look at your volume retention

> period. If you have 10 volumes and want just one of them be available at a

> time, set a volume use duration of 9 days (you can set in hours if you are

> sure about the last written time of your volumes).

>

> Best regards,

> Ana

>

The volume 000529L4 had status "Append" at the time the

jobs started, then moved to status "Used", at the time

of the "mount".

 

Beside that the volume 000529L4 was written

the day before the run, has a retention of 7 days and

was not neither "pruned", neither "purged" and not

marked as "Recycled".

 

Bacula wrote over a non empty, not pruned, not purged,

marked as "Used", Volume, leaving "dangling" jobs and

files alive into the database.

 

This shouldn't NEVER happen.

 

Am I wrong


Consider how Bacula treats the case where "maximum volume jobs = 1". The job starts to run and selects a volume marked "append", possibly first recycling a volume if no available "append" volumes are empty. It then marks the volume as "used" so that no other jobs will try to select it. After it is marked "used" the job continues and writes the job data to it. So, yes, there is a use for writing a volume after it is marked "used". Since multiple jobs may start at the same or nearly the same time, Bacula serializes volume selection by allowing only one job at a time to select a volume. So the job that marked it "used" writes to it, but no other job can subsequently select it.

I think something similar is happening when "use duration" runs out while the job is running. The "use duration" period begins when the volume is first written to, which is always AFTER the job starts. If the "use duration" is an integer multiple of the time period between job runs, then there will always be a job that starts just minutes or seconds BEFORE the  "use duration" expires. That causes the volume to get marked "used" during the job, though it was indeed marked "append" when the job first started. The job doesn't (and shouldn't) fail because of this. It continues and writes to the "used" volume.

Jobs that start after the volume is marked "used" will NOT select it when searching for a volume. This is why it is a good idea to make the "use duration" period a bit shorter. That way the "use duration" has already expired before the job starts.

So, I don't think you are "wrong". I just think you are miscalculating the exact time of the end of the "use duration" period, that the volume isn't being marked "used" until after the job has already started, meaning that the "Use duration" is too long.


------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users