> 
> Kern,
> 
> Do you think that it is valid for a VirtualFull backup to use a prior
> VirtualFull backup as a source?
> 
> I think that there is a bug where this is the case, and I don't know
> that it's valid anyway.
> 
> I would like to make a change so that when looking for 'source' jobs
> for a VirtualFull, only jobs in a Pool that has a Next Pool the same
as
> the current job pool should be considered.
> 
> So to put it in the context of my previous example:
> 
> 1. Full Backup (Pool = Disk, Next Pool = Tape)
> 2. Incremental Backup (Pool = Disk, Next Pool = Tape)
> 3. Incremental Backup (Pool = Disk, Next Pool = Tape)
> 4. VirtualFull Backup (Pool = Tape - because job pool = Disk and Disk
> Next Pool = Tape)
> 5. Incremental Backup (Pool = Disk, Next Pool = Tape)
> 6. VirtualFull Backup (***)
> 
> For (6), only Jobs with media in the Disk pool are to be considered
> 

This patch does what I'm talking about, but it's not well tested. My
assumption is that for a vbackup, by the time db_accurate_get_jobids is
called, jr->PoolId has already been set to the NextPool, so I only need
to make sure that the search for the most recent full backup excludes
the value of jr->PoolId.

James

Index: src/cats/sql_get.c
===================================================================
--- src/cats/sql_get.c  (revision 8587)
+++ src/cats/sql_get.c  (working copy)
@@ -1099,12 +1099,17 @@
                             JOB_DBR *jr, POOLMEM *jobids)
 {
    bool ret=false;
-   char clientid[50], jobid[50], filesetid[50];
+   char clientid[50], jobid[50], filesetid[50], poolid[50];
    char date[MAX_TIME_LENGTH];
    POOL_MEM query(PM_FNAME);
    bstrutime(date, sizeof(date),  time(NULL) + 1);
    jobids[0]='\0';

+   if (L_VIRTUAL_FULL) {
+     edit_uint64(jr->PoolId, poolid);
+   } else {
+     strcpy(poolid, "-1");
+   }
    /* First, find the last good Full backup for this job/client/fileset
*/
    Mmsg(query,
 "CREATE TABLE btemp3%s AS "
@@ -1114,11 +1119,13 @@
     "AND Level='F' AND JobStatus IN ('T','W') AND Type='B' "
     "AND StartTime<'%s' "
     "AND FileSet.FileSet=(SELECT FileSet FROM FileSet WHERE FileSetId =
%s) "
+    "AND PoolId <> %s "
   "ORDER BY Job.JobTDate DESC LIMIT 1",
         edit_uint64(jcr->JobId, jobid),
         edit_uint64(jr->ClientId, clientid),
         date,
-        edit_uint64(jr->FileSetId, filesetid));
+        edit_uint64(jr->FileSetId, filesetid),
+        poolid);

    if (!db_sql_query(mdb, query.c_str(), NULL, NULL)) {
       goto bail_out;

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Bacula-devel mailing list
Bacula-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-devel

Reply via email to