From: Alain Spineux Date: Thu, 14 Mar 2024 13:33:07 +0000 (+0100) Subject: Only normal backup jobs can become "Incomplete", MAC must return errors X-Git-Tag: Release-15.0.2~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a776ae5ba4e82eadb9175a3e48c113e57b84185b;p=thirdparty%2Fbacula.git Only normal backup jobs can become "Incomplete", MAC must return errors - 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 --- diff --git a/bacula/src/stored/append.c b/bacula/src/stored/append.c index 9dd474af2..ef67e69ef 100644 --- a/bacula/src/stored/append.c +++ b/bacula/src/stored/append.c @@ -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); } }