>>>>> On Wed, 29 Dec 2010 19:24:05 GMT, Martin Simmons said:
>
>>>>> On Tue, 28 Dec 2010 16:36:58 +0100, Jeremy Maes said:
> >
> > I posted the requested info as a comment on the bug report (since the
> > mantis signup seems fixed)
> > Everything can thus be found right here.
> > <http://bugs.bacula.org/view.php?id=1661>
> > (http://bugs.bacula.org/view.php?id=1661)
> >
> > If you'd rather have me post it to the list aswell, I'll gladly do that
> > aswell.
>
> Thanks, I can repeat it easily now as well.
>
> 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 bug#1524.
You could try the attached patch.
__Martin
--- src/cats/sql_get.c
+++ 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.
*/
@@ -115,8 +115,9 @@ int db_get_file_record(JCR *jcr, B_DB *mdb, JOB_DBR *jr,
FILE_DBR *fdbr)
SQL_ROW row;
int stat = 0;
char ed1[50], ed2[50], ed3[50];
+ int32_t level = jcr->getJobLevel();
- if (jcr->getJobLevel() == L_VERIFY_DISK_TO_CATALOG) {
+ if (level == L_VERIFY_DISK_TO_CATALOG) {
Mmsg(mdb->cmd,
"SELECT FileId, LStat, MD5 FROM File,Job WHERE "
"File.JobId=Job.JobId AND File.PathId=%s AND "
@@ -125,6 +126,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 (level == 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 "
------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users