From: <ke...@us...> - 2008-07-26 20:52:49
|
Revision: 7440 http://bacula.svn.sourceforge.net/bacula/?rev=7440&view=rev Author: kerns Date: 2008-07-26 20:52:58 +0000 (Sat, 26 Jul 2008) Log Message: ----------- 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. Modified Paths: -------------- trunk/bacula/src/dird/migrate.c trunk/bacula/technotes-2.5 Modified: trunk/bacula/src/dird/migrate.c =================================================================== --- trunk/bacula/src/dird/migrate.c 2008-07-26 20:52:40 UTC (rev 7439) +++ trunk/bacula/src/dird/migrate.c 2008-07-26 20:52:58 UTC (rev 7440) @@ -164,10 +164,6 @@ return true; /* no work */ } - Dmsg5(dbglevel, "JobId=%d: Previous: Name=%s JobId=%d Type=%c Level=%c\n", - (int)jcr->JobId, - jcr->previous_jr.Name, (int)jcr->previous_jr.JobId, - jcr->previous_jr.JobType, jcr->previous_jr.JobLevel); Dmsg5(dbglevel, "JobId=%d: Current: Name=%s JobId=%d Type=%c Level=%c\n", (int)jcr->JobId, @@ -280,13 +276,26 @@ 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 %s JobId %s, Job=%s\n"), jcr->get_JobType() == JT_MIGRATE ? "Migration" : "Copy", edit_uint64(jcr->JobId, ed1), jcr->Job); - - /* * Open a message channel connection with the Storage * daemon. This is to let him know that our client Modified: trunk/bacula/technotes-2.5 =================================================================== --- trunk/bacula/technotes-2.5 2008-07-26 20:52:40 UTC (rev 7439) +++ trunk/bacula/technotes-2.5 2008-07-26 20:52:58 UTC (rev 7440) @@ -32,6 +32,10 @@ General: +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 Set MALLOC_CHECK_=0 in environment before starting Bacula to turn off glibc checks that prevent getting good dumps. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |