From: Kern Sibbald Date: Fri, 29 Aug 2008 02:42:56 +0000 (+0000) Subject: Fix migration code broken by previous virtual backup fix X-Git-Tag: Release-3.0.0~1049 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=42fd18c2922bda7ab4b005df2be0c856c9a55fac;p=bacula%2Fbacula Fix migration code broken by previous virtual backup fix git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7524 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/stored/mac.c b/bacula/src/stored/mac.c index d988114b3b..de22d4f15b 100644 --- a/bacula/src/stored/mac.c +++ b/bacula/src/stored/mac.c @@ -208,22 +208,26 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec) case EOM_LABEL: return true; /* don't write vol labels */ } - /* - * For normal migration jobs, FileIndex values are sequential because - * we are dealing with one job. However, for Vbackup (consolidation), - * we will be getting records from multiple jobs and writing them back - * out, so we need to ensure that the output FileIndex is sequential. - * We do so by detecting a FileIndex change and incrementing the - * JobFiles, which we then use as the output FileIndex. - */ - if (rec->VolSessionId != last_VolSessionId || - rec->VolSessionTime != last_VolSessionTime || - (rec->FileIndex > 0 && rec->FileIndex != last_FileIndex)) { - jcr->JobFiles++; - last_VolSessionId = rec->VolSessionId; - last_VolSessionTime = rec->VolSessionTime; - last_FileIndex = rec->FileIndex; - rec->FileIndex = jcr->JobFiles; /* set sequential output FileIndex */ + if (jcr->get_JobType() == JT_BACKUP) { + /* + * For normal migration jobs, FileIndex values are sequential because + * we are dealing with one job. However, for Vbackup (consolidation), + * we will be getting records from multiple jobs and writing them back + * out, so we need to ensure that the output FileIndex is sequential. + * We do so by detecting a FileIndex change and incrementing the + * JobFiles, which we then use as the output FileIndex. + */ + if (rec->VolSessionId != last_VolSessionId || + rec->VolSessionTime != last_VolSessionTime || + (rec->FileIndex > 0 && rec->FileIndex != last_FileIndex)) { + jcr->JobFiles++; + last_VolSessionId = rec->VolSessionId; + last_VolSessionTime = rec->VolSessionTime; + last_FileIndex = rec->FileIndex; + } + if (rec->FileIndex > 0) { + rec->FileIndex = jcr->JobFiles; /* set sequential output FileIndex */ + } } /* * Modify record SessionId and SessionTime to correspond to diff --git a/bacula/src/version.h b/bacula/src/version.h index 363eb9c58a..66506f3234 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -4,8 +4,8 @@ #undef VERSION #define VERSION "2.5.3" -#define BDATE "28 Aug 2008" -#define LSMDATE "28Aug08" +#define BDATE "29 Aug 2008" +#define LSMDATE "29Aug08" #define PROG_COPYRIGHT "Copyright (C) %d-2008 Free Software Foundation Europe e.V.\n" #define BYEAR "2008" /* year for copyright messages in progs */ diff --git a/bacula/technotes-2.5 b/bacula/technotes-2.5 index e06dec0029..47682f1f14 100644 --- a/bacula/technotes-2.5 +++ b/bacula/technotes-2.5 @@ -32,6 +32,8 @@ separator in console (!$%&'()*+,-/:;<>?[]^`{|}~) General: +29Aug08 +kes Fix migration code broken by previous virtual backup fix. 28Aug08 kes Fix problem of Virtual backup not writing a sequential FileIndex. kes Reset Virtual backup time/date to the value from the last backup.