From: Kern Sibbald Date: Wed, 8 Oct 2008 10:28:44 +0000 (+0000) Subject: This patch should correct bug #1159 where Migration does not properly X-Git-Tag: Release-2.4.3~6 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=51b2ef096bd67b56c6a7ac3808c8eb2e8155def0;p=bacula%2Fbacula This patch should correct bug #1159 where Migration does not properly respect the Migration Low Bytes directive. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/branches/Branch-2.4@7729 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/patches/2.4.2-migrate-poolsize.patch b/bacula/patches/2.4.2-migrate-poolsize.patch new file mode 100644 index 0000000000..986ec97e31 --- /dev/null +++ b/bacula/patches/2.4.2-migrate-poolsize.patch @@ -0,0 +1,39 @@ + + This patch should correct bug #1159 where Migration does not properly + respect the Migration Low Bytes directive. + + Apply it to Bacula version 2.4.2 (or possibly earlier) with: + + cd + patch -p0 <2.4.2-migrate-poolsize.patch + ./configure + make + ... + make install + + +Index: src/dird/migrate.c +=================================================================== +--- src/dird/migrate.c (revision 7566) ++++ src/dird/migrate.c (working copy) +@@ -557,13 +557,16 @@ + " AND Job.Type='B'" + " ORDER by Job.StartTime"; + +-/* Get tne number of bytes in the pool */ ++/* Get the number of bytes in the pool */ + const char *sql_pool_bytes = +- "SELECT SUM(VolBytes) FROM Media,Pool WHERE" ++ "SELECT SUM(JobBytes) FROM Job WHERE JobId IN" ++ " (SELECT DISTINCT Job.JobId from Pool,Job,Media,JobMedia WHERE" ++ " Pool.Name='%s' AND Media.PoolId=Pool.PoolId AND" + " VolStatus in ('Full','Used','Error','Append') AND Media.Enabled=1 AND" +- " Media.PoolId=Pool.PoolId AND Pool.Name='%s'"; ++ " Job.Type='B' AND" ++ " JobMedia.JobId=Job.JobId AND Job.PoolId=Media.PoolId)"; + +-/* Get tne number of bytes in the Jobs */ ++/* Get the number of bytes in the Jobs */ + const char *sql_job_bytes = + "SELECT SUM(JobBytes) FROM Job WHERE JobId IN (%s)"; + diff --git a/bacula/src/dird/migrate.c b/bacula/src/dird/migrate.c index d36d63b7a6..a1b54c40f0 100644 --- a/bacula/src/dird/migrate.c +++ b/bacula/src/dird/migrate.c @@ -557,13 +557,16 @@ const char *sql_jobids_from_mediaid = " AND Job.Type='B'" " ORDER by Job.StartTime"; -/* Get tne number of bytes in the pool */ +/* Get the number of bytes in the pool */ const char *sql_pool_bytes = - "SELECT SUM(VolBytes) FROM Media,Pool WHERE" + "SELECT SUM(JobBytes) FROM Job WHERE JobId IN" + " (SELECT DISTINCT Job.JobId from Pool,Job,Media,JobMedia WHERE" + " Pool.Name='%s' AND Media.PoolId=Pool.PoolId AND" " VolStatus in ('Full','Used','Error','Append') AND Media.Enabled=1 AND" - " Media.PoolId=Pool.PoolId AND Pool.Name='%s'"; + " Job.Type='B' AND" + " JobMedia.JobId=Job.JobId AND Job.PoolId=Media.PoolId)"; -/* Get tne number of bytes in the Jobs */ +/* Get the number of bytes in the Jobs */ const char *sql_job_bytes = "SELECT SUM(JobBytes) FROM Job WHERE JobId IN (%s)"; diff --git a/bacula/src/version.h b/bacula/src/version.h index 5355414598..efd5a98f21 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -4,8 +4,8 @@ #undef VERSION #define VERSION "2.4.3" -#define BDATE "26 August 2008" -#define LSMDATE "26Aug08" +#define BDATE "08 October 2008" +#define LSMDATE "08Oct08" #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.4 b/bacula/technotes-2.4 index fd739edd52..17bcc1240e 100644 --- a/bacula/technotes-2.4 +++ b/bacula/technotes-2.4 @@ -1,6 +1,9 @@ Technical notes on version 2.4 General: +08Oct08 +kes This should correct bug #1159 where Migration does not properly + respect the Migration Low Bytes directive. 02Oct08 ebl Fix typo in configure.in that breaks --with-db-password option 24Sep08