]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Fix incorrect backport for patch #7451 about deleted files in virtualfull
authorEric Bollengier <eric@baculasystems.com>
Fri, 23 Apr 2021 07:02:43 +0000 (09:02 +0200)
committerEric Bollengier <eric@baculasystems.com>
Thu, 24 Mar 2022 08:03:01 +0000 (09:03 +0100)
bacula/src/dird/vbackup.c
regress/tests/virtual-deleted-files-test

index 9e7d192e37238482d81305171af1db1064b5c623..48d22fa3c23148750f8d279b2370c1b956e29523 100644 (file)
@@ -592,8 +592,15 @@ static bool create_bootstrap_file(JCR *jcr, char *jobids)
       Jmsg0(jcr, M_FATAL, 0, "Can't get batch sql connexion");
       return false;
    }
-
-   if (!db_get_file_list(jcr, jcr->db_batch, jobids, DBL_USE_DELTA,
+   /* If the new Job is a Full, we don't need to keep deleted records,
+    * however, if it's an incremental/differential, we should not restore
+    * the files from the Full, so we keep the deleted records
+    */
+   int opt = DBL_USE_DELTA;
+   if (jcr->jr.JobLevel != 'F') {
+      opt |= DBL_ALL_FILES;
+   }
+   if (!db_get_file_list(jcr, jcr->db_batch, jobids, opt,
                          insert_bootstrap_handler, (void *)rx.bsr_list))
    {
       Jmsg(jcr, M_ERROR, 0, "%s", db_strerror(jcr->db_batch));
index f7ce901b8ec18a32ef5deed116b06b3eb82e2a7d..82c072ba4acc3caa6fde5c6cb65da76c5bd27c2f 100755 (executable)
@@ -71,6 +71,6 @@ check_for_zombie_jobs storage=File
 
 stop_bacula
 check_two_logs
-check_restore_diff
+$rscripts/diff.pl -s $cwd/build -d $tmp/bacula-restores3/$cwd/build
 
 end_test