]> git.sur5r.net Git - bacula/bacula/commitdiff
Do not update Migrated Job type if migration does not terminate
authorKern Sibbald <kern@sibbald.com>
Fri, 1 Dec 2006 20:31:59 +0000 (20:31 +0000)
committerKern Sibbald <kern@sibbald.com>
Fri, 1 Dec 2006 20:31:59 +0000 (20:31 +0000)
     normally. This fixes bug #719.

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3730 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/dird/migrate.c
bacula/technotes-1.39

index 36ac5de4f8de8a2672d3d13b0c3832d8346adf82..aa534382e0ae619c63f12dcdc3cb9d207a22fee7 100644 (file)
@@ -999,10 +999,12 @@ void migration_cleanup(JCR *jcr, int TermCode)
          edit_uint64(mig_jcr->jr.JobId, ec2));
       db_sql_query(mig_jcr->db, query.c_str(), NULL, NULL);
 
-      /* Now marke the previous job as migrated */
-      Mmsg(query, "UPDATE Job SET Type='%c' WHERE JobId=%s",
-           (char)JT_MIGRATED_JOB, edit_uint64(jcr->previous_jr.JobId, ec1));
-      db_sql_query(mig_jcr->db, query.c_str(), NULL, NULL);
+      /* Now mark the previous job as migrated if it terminated normally */
+      if (jcr->JobStatus == JS_Terminated) {
+         Mmsg(query, "UPDATE Job SET Type='%c' WHERE JobId=%s",
+              (char)JT_MIGRATED_JOB, edit_uint64(jcr->previous_jr.JobId, ec1));
+         db_sql_query(mig_jcr->db, query.c_str(), NULL, NULL);
+      } 
 
       if (!db_get_job_record(jcr, jcr->db, &jcr->jr)) {
          Jmsg(jcr, M_WARNING, 0, _("Error getting job record for stats: %s"),
@@ -1021,7 +1023,7 @@ void migration_cleanup(JCR *jcr, int TermCode)
 
       if (!db_get_job_volume_names(mig_jcr, mig_jcr->db, mig_jcr->jr.JobId, &mig_jcr->VolumeName)) {
          /*
-          * Note, if the job has erred, most likely it did not write any
+          * Note, if the job has failed, most likely it did not write any
           *  tape, so suppress this "error" message since in that case
           *  it is normal.  Or look at it the other way, only for a
           *  normal exit should we complain about this error.
index eedab7686112f65c5f629231b5bf52b8d388fe1b..a03e20e7897c8284f90c37330efe5ef009381c2e 100644 (file)
@@ -2,6 +2,8 @@
 
 General:
 01Dec06
+kes  Do not update Migrated Job type if migration does not terminate
+     normally. This fixes bug #719.
 kes  Update ReleaseNotes
 kes  Purge Job records from the catalog for Migration. This was
      not properly done previously. This fixes bug #718.