Package: bacula Version: 5.0.2-2.2+squeeze1 Severity: normal Tags: patch Debian squeeze #cat /etc/debian_version 6.0.6
#dpkg -l bacula\* | grep ^ii | cut -c5-65 bacula-common 5.0.2-2.2+squeeze1 bacula-common-pgsql 5.0.2-2.2+squeeze1 bacula-console 5.0.2-2.2+squeeze1 bacula-director-common 5.0.2-2.2+squeeze1 bacula-director-pgsql 5.0.2-2.2+squeeze1 bacula-doc 5.0.2-1 bacula-fd 5.0.2-2.2+squeeze1 bacula-sd 5.0.2-2.2+squeeze1 bacula-sd-pgsql 5.0.2-2.2+squeeze1 03-Nov 00:04 vsrvbck01-dir JobId 35711: Verifying against JobId=35699 Job=srvxen02-Tape.2012-11-02_23.05.01_53 03-Nov 00:04 vsrvbck01-dir JobId 35711: Bootstrap records written to /var/lib/bacula/vsrvbck01-dir.restore.34.bsr 03-Nov 00:04 vsrvbck01-dir JobId 35711: Start Verify JobId=35711 Level=VolumeToCatalog Job=srvxen02-Tape-Verify.2012-11-02_23.10.00_05 03-Nov 00:04 vsrvbck01-dir JobId 35711: Using Device "Drive0_SB5" 03-Nov 00:06 vsrvbck01-sd JobId 35711: Ready to read from volume "HP1054L3" on device "Drive0_SB5" (/dev/nst3). 03-Nov 00:06 vsrvbck01-sd JobId 35711: Forward spacing Volume "HP1054L3" to file:block 147:0. 03-Nov 00:28 vsrvbck01-dir JobId 35711: Warning: The following files are in the Catalog but not on the Volume(s): 03-Nov 00:28 vsrvbck01-dir JobId 35711: /boot/ 03-Nov 00:28 vsrvbck01-dir JobId 35711: Bacula vsrvbck01-dir 5.0.2 (28Apr10): 03-Nov-2012 00:28:50 Build OS: x86_64-pc-linux-gnu debian 6.0.6 JobId: 35711 Job: srvxen02-Tape-Verify.2012-11-02_23.10.00_05 FileSet: None Verify Level: VolumeToCatalog Client: srvxen02-fd Verify JobId: 35699 Verify Job: Start time: 03-Nov-2012 00:04:44 End time: 03-Nov-2012 00:28:50 Files Expected: 371,031 Files Examined: 371,031 Non-fatal FD errors: 0 FD termination status: OK SD termination status: OK Termination: Verify Differences 03-Nov 00:28 vsrvbck01-dir JobId 35711: Begin pruning Jobs older than 2 months . 03-Nov 00:28 vsrvbck01-dir JobId 35711: No Jobs found to prune. 03-Nov 00:28 vsrvbck01-dir JobId 35711: Begin pruning Jobs. 03-Nov 00:28 vsrvbck01-dir JobId 35711: No Files found to prune. 03-Nov 00:28 vsrvbck01-dir JobId 35711: End auto prune. The problem is that the File table in the catalog contains two entries for All of the inner mounted filesystems (/boot etc), one which would normally be Used to recreate the mount point and another for the top level directory of the filesystem itself. This confuses the VolumeToCatalog verification code. It looks like it was broken by the fix for bacula_bug#1524. http://bugs.bacula.org/view.php?id=1661 In L_VERIFY_VOLUME_TO_CATALOG, it needs to check every FileIndex to ensure that the catalog is in the same order as the volume. That also correctly handles duplicate names, which have different values for FileIndex. http://bacula.git.sourceforge.net/git/gitweb.cgi?p=bacula/bacula;a=commit;h=626d681b782437c44b12a9e77627312260544062 >From 626d681b782437c44b12a9e77627312260544062 Mon Sep 17 00:00:00 2001 From: Martin Simmons <[email protected]<mailto:[email protected]>> Date: Wed, 5 Jan 2011 10:19:22 +0100 Subject: [PATCH] Fix #1661 about verify differences with VERIFY_VOLUME_TO_CATALOG In L_VERIFY_VOLUME_TO_CATALOG, it needs to check every FileIndex to ensure that the catalog is in the same order as the volume. That also correctly handles duplicate names, which have different values for FileIndex. This bug was introduced when fixing #1524 --- bacula/src/cats/sql_get.c | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/bacula/src/cats/sql_get.c b/bacula/src/cats/sql_get.c index e4ebfba..d3d21a2 100644 --- a/bacula/src/cats/sql_get.c +++ b/bacula/src/cats/sql_get.c @@ -105,7 +105,7 @@ int db_get_file_attributes_record(JCR *jcr, B_DB *mdb, char *fname, JOB_DBR *jr, * use includes the directory twice. In this case, Verify * VolumeToCatalog fails because we have two copies in the catalog, * and only the first one is marked (twice). So, when calling from Verify, - * jr is not NULL and we know jr->FileIndex is the fileindex + * VolumeToCatalog jr is not NULL and we know jr->FileIndex is the fileindex * of the version of the directory/file we actually want and do * a more explicit SQL search. */ @@ -125,6 +125,14 @@ int db_get_file_record(JCR *jcr, B_DB *mdb, JOB_DBR *jr, FILE_DBR *fdbr) edit_int64(fdbr->PathId, ed1), edit_int64(fdbr->FilenameId, ed2), edit_int64(jr->ClientId,ed3)); + } else if (jcr->getJobLevel() == L_VERIFY_VOLUME_TO_CATALOG) { + Mmsg(mdb->cmd, + "SELECT FileId, LStat, MD5 FROM File WHERE File.JobId=%s AND File.PathId=%s AND " + "File.FilenameId=%s AND File.FileIndex=%u", + edit_int64(fdbr->JobId, ed1), + edit_int64(fdbr->PathId, ed2), + edit_int64(fdbr->FilenameId,ed3), + jr->FileIndex); } else { Mmsg(mdb->cmd, "SELECT FileId, LStat, MD5 FROM File WHERE File.JobId=%s AND File.PathId=%s AND " -- 1.7.4.1

