]> git.sur5r.net Git - bacula/bacula/blob - bacula/patches/2.4.1-migration.patch
Add some patches
[bacula/bacula] / bacula / patches / 2.4.1-migration.patch
1
2  This patch should help prevent jobs from being migrated twice if 
3  you happen to run two migration jobs at the same time. This should
4  fix or improve the problem reported in bug #1129.
5  Apply it to version 2.4.1 with:
6
7  cd <bacula-source>
8  patch -p0 <2.4.1-migration.patch
9  ./configure <your-options>
10  make
11  ...
12  make install
13
14
15  
16 Index: src/dird/migrate.c
17 ===================================================================
18 --- src/dird/migrate.c  (revision 7433)
19 +++ src/dird/migrate.c  (working copy)
20 @@ -1,7 +1,7 @@
21  /*
22     Bacula® - The Network Backup Solution
23  
24 -   Copyright (C) 2004-2007 Free Software Foundation Europe e.V.
25 +   Copyright (C) 2004-2008 Free Software Foundation Europe e.V.
26  
27     The main author of Bacula is Kern Sibbald, with contributions from
28     many others, a complete list can be found in the file AUTHORS.
29 @@ -274,6 +274,21 @@
30        return true;
31     }
32  
33 +   if (!db_get_job_record(jcr, jcr->db, &jcr->previous_jr)) {
34 +      Jmsg(jcr, M_FATAL, 0, _("Could not get job record for JobId %s to migrate. ERR=%s"),
35 +           edit_int64(jcr->previous_jr.JobId, ed1),
36 +           db_strerror(jcr->db));
37 +      set_jcr_job_status(jcr, JS_Terminated);
38 +      migration_cleanup(jcr, jcr->JobStatus);
39 +      return true;
40 +   }
41 +   /* Make sure this job was not already migrated */
42 +   if (jcr->previous_jr.JobType != JT_BACKUP) {
43 +      set_jcr_job_status(jcr, JS_Terminated);
44 +      migration_cleanup(jcr, jcr->JobStatus);
45 +      return true;
46 +   }
47 +
48     /* Print Job Start message */
49     Jmsg(jcr, M_INFO, 0, _("Start Migration JobId %s, Job=%s\n"),
50          edit_uint64(jcr->JobId, ed1), jcr->Job);