]> git.sur5r.net Git - bacula/bacula/commitdiff
kes When a migration job actually runs, re-check the Job record
authorKern Sibbald <kern@sibbald.com>
Sat, 26 Jul 2008 20:52:40 +0000 (20:52 +0000)
committerKern Sibbald <kern@sibbald.com>
Sat, 26 Jul 2008 20:52:40 +0000 (20:52 +0000)
     and skip if the job is already migrated. This should
     significantly reduce the problems with bug #1129.

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/branches/Branch-2.4@7439 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/dird/migrate.c
bacula/src/version.h
bacula/technotes-2.4

index 9c4dc8a314bc537874632675bfdc10e6646d8353..8a02099f1d7dda33ab3614977cf3b1f28ffb03f8 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2004-2007 Free Software Foundation Europe e.V.
+   Copyright (C) 2004-2008 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
@@ -274,6 +274,21 @@ bool do_migration(JCR *jcr)
       return true;
    }
 
+   if (!db_get_job_record(jcr, jcr->db, &jcr->previous_jr)) {
+      Jmsg(jcr, M_FATAL, 0, _("Could not get job record for JobId %s to migrate. ERR=%s"),
+           edit_int64(jcr->previous_jr.JobId, ed1),
+           db_strerror(jcr->db));
+      set_jcr_job_status(jcr, JS_Terminated);
+      migration_cleanup(jcr, jcr->JobStatus);
+      return true;
+   }
+   /* Make sure this job was not already migrated */
+   if (jcr->previous_jr.JobType != JT_BACKUP) {
+      set_jcr_job_status(jcr, JS_Terminated);
+      migration_cleanup(jcr, jcr->JobStatus);
+      return true;
+   }
+
    /* Print Job Start message */
    Jmsg(jcr, M_INFO, 0, _("Start Migration JobId %s, Job=%s\n"),
         edit_uint64(jcr->JobId, ed1), jcr->Job);
index 8e6d38ccfa2a0c3ce6540316a12b090e0647bcae..3596458a01c7463cbd86b5eca8eac65c64bf7811 100644 (file)
@@ -4,8 +4,8 @@
 
 #undef  VERSION
 #define VERSION "2.4.2"
-#define BDATE   "24 July 2008"
-#define LSMDATE "24Jul08"
+#define BDATE   "26 July 2008"
+#define LSMDATE "26Jul08"
 
 #define PROG_COPYRIGHT "Copyright (C) %d-2008 Free Software Foundation Europe e.V.\n"
 #define BYEAR "2008"       /* year for copyright messages in progs */
index 30950b544603ac26496c8f20a5e2634b884bbcd5..6947c764333dd810b4c2d47f0ea26a474a7a0f8b 100644 (file)
@@ -2,6 +2,10 @@
 
 General:
 Release Version 2.4.2
+26Jul08
+kes  When a migration job actually runs, re-check the Job record
+     and skip if the job is already migrated. This should
+     significantly reduce the problems with bug #1129.
 24Jul08
 kes  Break the do_swapping into do_unload, do_swapping, and
      do_load.  It is much more logical that way.