]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Only normal backup jobs can become "Incomplete", MAC must return errors
authorAlain Spineux <alain@baculasystems.com>
Thu, 14 Mar 2024 13:33:07 +0000 (14:33 +0100)
committerEric Bollengier <eric@baculasystems.com>
Thu, 21 Mar 2024 16:23:07 +0000 (17:23 +0100)
- jcr->sd_client is set when the SD is acting as a client from the point
  of view of the control job that is "restoring" the job  up
  to the other SD. It is set only for SD <-> SD
- The control job as a different cr->getJobType()
FROM
 JobId  Level     Files      Bytes   Status   Finished        Name
====================================================================
     1  Full       3,087    49.77 M  OK       13-Mar-24 16:49 MigrationJobSave
     2  Full         795    5.900 M  Error    13-Mar-24 16:49 migrate-job
     3  Full         795    5.900 M  Incomplete  13-Mar-24 16:49 MigrationJobSave
TO
     1  Full       3,087    49.77 M  OK       14-Mar-24 19:25 MigrationJobSave
     2  Full         795    5.900 M  Error    14-Mar-24 19:26 migrate-job
     3  Full         795    5.900 M  Error    14-Mar-24 19:26 MigrationJobSave

bacula/src/stored/append.c

index 9dd474af2c99f71f76dc87d1103bd8c6f327c2a5..ef67e69ef188ca01b00d06f1e6801112510ff95d 100644 (file)
@@ -49,9 +49,13 @@ void possible_incomplete_job(JCR *jcr, uint32_t last_file_index)
     * We cannot mark a job Incomplete if we have already flushed
     *  a bad JobMedia record (i.e. one beyond the last FileIndex
     *  that is known to be good).
+    * Only backups of type JT_BACKUP are handled for now.
+    * Be careful MAC backups keep the type of the source job aka JT_BACKUP
+    * but have the jcr->sd_client set.
     */
    if (jcr->spool_attributes && last_file_index > 10 &&
-       dir->get_lastFlushIndex() < last_file_index) {
+       dir->get_lastFlushIndex() < last_file_index &&
+       jcr->getJobType() == JT_BACKUP && !jcr->sd_client) {
       jcr->setJobStatus(JS_Incomplete);
    }
 }