From dec3c14e71d4c1c9e0d6f408facea4e019929ad4 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sat, 26 Jul 2008 20:52:40 +0000 Subject: [PATCH] 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. 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 | 17 ++++++++++++++++- bacula/src/version.h | 4 ++-- bacula/technotes-2.4 | 4 ++++ 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/bacula/src/dird/migrate.c b/bacula/src/dird/migrate.c index 9c4dc8a314..8a02099f1d 100644 --- a/bacula/src/dird/migrate.c +++ b/bacula/src/dird/migrate.c @@ -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); diff --git a/bacula/src/version.h b/bacula/src/version.h index 8e6d38ccfa..3596458a01 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -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 */ diff --git a/bacula/technotes-2.4 b/bacula/technotes-2.4 index 30950b5446..6947c76433 100644 --- a/bacula/technotes-2.4 +++ b/bacula/technotes-2.4 @@ -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. -- 2.39.5