]> git.sur5r.net Git - bacula/bacula/blob - bacula/patches/2.4.2-migrate-poolsize.patch
ebl Update patch for #1166 with select() instead of kill
[bacula/bacula] / bacula / patches / 2.4.2-migrate-poolsize.patch
1
2  This patch should correct bug #1159 where Migration does not properly
3  respect the Migration Low Bytes directive. 
4
5  Apply it to Bacula version 2.4.2 (or possibly earlier) with:
6
7    cd <bacula-source>
8    patch -p0 <2.4.2-migrate-poolsize.patch
9    ./configure <your-options>
10    make
11    ...
12    make install
13
14
15 Index: src/dird/migrate.c
16 ===================================================================
17 --- src/dird/migrate.c  (revision 7566)
18 +++ src/dird/migrate.c  (working copy)
19 @@ -557,13 +557,16 @@
20     " AND Job.Type='B'"
21     " ORDER by Job.StartTime";
22  
23 -/* Get tne number of bytes in the pool */
24 +/* Get the number of bytes in the pool */
25  const char *sql_pool_bytes =
26 -   "SELECT SUM(VolBytes) FROM Media,Pool WHERE"
27 +   "SELECT SUM(JobBytes) FROM Job WHERE JobId IN"
28 +   " (SELECT DISTINCT Job.JobId from Pool,Job,Media,JobMedia WHERE"
29 +   " Pool.Name='%s' AND Media.PoolId=Pool.PoolId AND"
30     " VolStatus in ('Full','Used','Error','Append') AND Media.Enabled=1 AND"
31 -   " Media.PoolId=Pool.PoolId AND Pool.Name='%s'";
32 +   " Job.Type='B' AND"
33 +   " JobMedia.JobId=Job.JobId AND Job.PoolId=Media.PoolId)";
34  
35 -/* Get tne number of bytes in the Jobs */
36 +/* Get the number of bytes in the Jobs */
37  const char *sql_job_bytes =
38     "SELECT SUM(JobBytes) FROM Job WHERE JobId IN (%s)";
39