From: Kern Sibbald Date: Sat, 30 Jun 2007 20:15:13 +0000 (+0000) Subject: kes Integrate patch from Sergey Svishchev that fixes X-Git-Tag: Release-7.0.0~6052 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=4144d0d599da52008bcf74201cc158848570a154;p=bacula%2Fbacula kes Integrate patch from Sergey Svishchev that fixes bug in migration code where a job that spanned two volumes was migrated twice. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5116 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/kernstodo b/bacula/kernstodo index 3fd1513432..c182a15538 100644 --- a/bacula/kernstodo +++ b/bacula/kernstodo @@ -1,5 +1,5 @@ Kern's ToDo List - 087 June 2007 + 29 June 2007 Document: @@ -58,6 +58,7 @@ Professional Needs: http://www.microsoft.com/technet/itshowcase/content/exchbkup.mspx Priority: +- No where in restore causes kaboom. - Performance: multiple spool files for a single job. - Performance: despool attributes when despooling data (problem multiplexing Dir connection). diff --git a/bacula/src/dird/migrate.c b/bacula/src/dird/migrate.c index 9e27035119..32afb06a95 100644 --- a/bacula/src/dird/migrate.c +++ b/bacula/src/dird/migrate.c @@ -596,7 +596,7 @@ static int get_job_to_migrate(JCR *jcr) char ed1[30], ed2[30]; POOL_MEM query(PM_MESSAGE); JobId_t JobId; - DBId_t MediaId = 0; + DBId_t DBId = 0; int stat; char *p; idpkt ids, mid, jids; @@ -703,36 +703,29 @@ static int get_job_to_migrate(JCR *jcr) } Dmsg2(dbglevel, "Pool Occupancy ids=%d MediaIds=%s\n", ids.count, ids.list); - /* - * Now loop over MediaIds getting more JobIds to migrate until - * we reduce the pool occupancy below the low water mark. - */ + if (!find_jobids_from_mediaid_list(jcr, &ids, "Volumes")) { + goto bail_out; + } + /* ids == list of jobs */ p = ids.list; for (int i=0; i < (int)ids.count; i++) { - stat = get_next_dbid_from_list(&p, &MediaId); - Dmsg2(dbglevel, "get_next_dbid stat=%d MediaId=%u\n", stat, MediaId); + stat = get_next_dbid_from_list(&p, &DBId); + Dmsg2(dbglevel, "get_next_dbid stat=%d JobId=%u\n", stat, (uint32_t)DBId); if (stat < 0) { - Jmsg(jcr, M_FATAL, 0, _("Invalid MediaId found.\n")); + Jmsg(jcr, M_FATAL, 0, _("Invalid JobId found.\n")); goto bail_out; } else if (stat == 0) { break; } + mid.count = 1; - Mmsg(mid.list, "%s", edit_int64(MediaId, ed1)); - if (!find_jobids_from_mediaid_list(jcr, &mid, "Volumes")) { - continue; - } - if (mid.count == 0) { - continue; /* nothing returned */ - } - if (i != 0) { + Mmsg(mid.list, "%s", edit_int64(DBId, ed1)); + if (jids.count > 0) { pm_strcat(jids.list, ","); } pm_strcat(jids.list, mid.list); jids.count += mid.count; - /* Now get the count of bytes added */ - ctx.count = 0; /* Find count of bytes from Jobs */ Mmsg(query, sql_job_bytes, mid.list); Dmsg1(dbglevel, "Jobbytes query: %s\n", query.c_str()); @@ -749,7 +742,6 @@ static int get_job_to_migrate(JCR *jcr) Dmsg0(dbglevel, "We should be done.\n"); break; } - } /* Transfer jids to ids, where the jobs list is expected */ ids.count = jids.count; diff --git a/bacula/src/version.h b/bacula/src/version.h index 54839b0f67..38d66870c6 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -4,8 +4,8 @@ #undef VERSION #define VERSION "2.1.23" -#define BDATE "29 June 2007" -#define LSMDATE "29Jun07" +#define BDATE "30 June 2007" +#define LSMDATE "30Jun07" #define PROG_COPYRIGHT "Copyright (C) %d-2007 Free Software Foundation Europe e.V.\n" #define BYEAR "2007" /* year for copyright messages in progs */ diff --git a/bacula/technotes-2.1 b/bacula/technotes-2.1 index 9b3026fe3d..86bc645d19 100644 --- a/bacula/technotes-2.1 +++ b/bacula/technotes-2.1 @@ -1,6 +1,10 @@ Technical notes on version 2.1 General: +30Jun07 +kes Integrate patch from Sergey Svishchev that fixes + bug in migration code where a job that spanned two volumes + was migrated twice. 29Jun07 kes Implement new BST_DESPOOLING blocked state. Change from locking during despooling in SD to blocking. This means that other threads