Bacula-users

Re: [Bacula-users] File jobs purged when they should not

2012-12-01 15:46:34
Subject: Re: [Bacula-users] File jobs purged when they should not
From: Sergey Vlasov <vsu AT altlinux DOT ru>
To: Felip Moll <lipixx AT gmail DOT com>
Date: Sun, 2 Dec 2012 00:42:29 +0400
On Tue, 20 Nov 2012 20:06:04 +0100 Felip Moll wrote:

> So, my problem is that the retention period that I defined in the pools are
> applied to the client regardless of the pool where the backup job is done?
> 
> So, probably, the pool defined for a 7 days retention is pruning all files
> from the backups defined to run in a different pool, eg. 4 weeks, 1 month,
> 5 years pools... "messing up" these jobs.

Looks like this is the case, together with the fact you stated at the
start of this thread:

> I use a Bacula version 5.0.3 (pretty old but I need to know if its a
> problem of my config or a bug of this version), in a production server.

>>From the source code of the prune_files() function in version 5.0.3:

  
http://www.bacula.org/git/cgit.cgi/bacula/tree/bacula/src/dird/ua_prune.c?id=fb469c80dbcc01d0c9bf0f23892776861cb4d8c1#n231

I see that it uses the "pool" argument only to get the file retention
period from pool settings, but does not use it to limit the set of jobs
selected for pruning.  Therefore Bacula 5.0.3 will happily prune files
of jobs which went to pools with a long file retention period after
doing a backup to a pool with a short file retention period - which is
exactly the behavior you see.

Now, if you look at the implementation of the same function in the most
current release (Bacula 5.2.12):

  
http://www.bacula.org/git/cgit.cgi/bacula/tree/bacula/src/dird/ua_prune.c?id=1a99202274db21af96e206968c05f352249bd8cf#n271

you will see significant changes - in particular, now it calls the newly
added prune_set_filter() function, which limits the set of jobs selected
for pruning using not only the client, but also the pool.  Therefore in
this version the autopruning process done after a backup will prune only
files from jobs which went to the same pool as the completed job, and
should not interfere with jobs that went to other pools.

Actually, when looking at commit logs, I have found the commit which
fixed the bug:

  
http://www.bacula.org/git/cgit.cgi/bacula/commit/?id=6b67f953ed9d47382b457e0ce322fd1feba10ac1

and the bugreport (login with anonymous/anonymous for read-only access):

  http://bugs.bacula.org/view.php?id=1601

Looks like the bug was never fixed on the 5.0 branch, only 5.2.x
releases have the fix.

> I have some clients with TiB of data, and I would like to have a list of
> files to recover in a 7 days period, and every 7 days prune oldest jobs and
> files. I want also that this clients backup their data to the pool of 1
> month and 5y, but not saving files... so from what you said, i must define
> multiple clients for every "real client".

This is probably the only option for you if you cannot upgrade to 5.2.x
(or backport the fix to your old version).

------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
INSIGHTS What's next for parallel hardware, programming and related areas?
Interviews and blogs by thought leaders keep you ahead of the curve.
http://goparallel.sourceforge.net
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users

<Prev in Thread] Current Thread [Next in Thread>
  • Re: [Bacula-users] File jobs purged when they should not, Sergey Vlasov <=