From: Kern Sibbald Date: Mon, 21 Feb 2011 10:30:57 +0000 (+0100) Subject: Rework Incomplete job intereaction with Base and Accurate X-Git-Tag: Release-7.0.0~1123 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9bc238012a8bd805745630ebd7fda3bcad068457;p=bacula%2Fbacula Rework Incomplete job intereaction with Base and Accurate --- diff --git a/bacula/src/dird/backup.c b/bacula/src/dird/backup.c index d188e375cb..f978df13bb 100644 --- a/bacula/src/dird/backup.c +++ b/bacula/src/dird/backup.c @@ -242,36 +242,36 @@ bool send_accurate_current_files(JCR *jcr) db_list_ctx nb; char ed1[50]; + /* In base level, no previous job is used and no restart incomplete jobs */ + if (jcr->is_canceled() || jcr->is_JobLevel(L_BASE)) { + return true; + } + if (!jcr->accurate && !jcr->incomplete) { + return true; + } + /* For incomplete Jobs, we add our own id */ if (jcr->incomplete) { edit_int64(jcr->JobId, ed1); jobids.add(ed1); - } else { - if (!jcr->accurate || job_canceled(jcr)) { - return true; - } - /* In base level, no previous job is used */ - if (jcr->is_JobLevel(L_BASE)) { + } + + if (jcr->is_JobLevel(L_FULL)) { + /* On Full mode, if no previous base job, no accurate things */ + if (!get_base_jobids(jcr, &jobids) && !jcr->incomplete) { return true; } - - if (jcr->is_JobLevel(L_FULL)) { - /* On Full mode, if no previous base job, no accurate things */ - if (!get_base_jobids(jcr, &jobids)) { - return true; - } - jcr->HasBase = true; - Jmsg(jcr, M_INFO, 0, _("Using BaseJobId(s): %s\n"), jobids.list); + jcr->HasBase = true; + Jmsg(jcr, M_INFO, 0, _("Using BaseJobId(s): %s\n"), jobids.list); - } else { - /* For Incr/Diff level, we search for older jobs */ - db_accurate_get_jobids(jcr, jcr->db, &jcr->jr, &jobids); + } else { + /* For Incr/Diff level, we search for older jobs */ + db_accurate_get_jobids(jcr, jcr->db, &jcr->jr, &jobids); - /* We are in Incr/Diff, but no Full to build the accurate list... */ - if (jobids.count == 0) { - Jmsg(jcr, M_FATAL, 0, _("Cannot find previous jobids.\n")); - return false; /* fail */ - } + /* We are in Incr/Diff, but no Full to build the accurate list... */ + if (jobids.count == 0) { + Jmsg(jcr, M_FATAL, 0, _("Cannot find previous jobids.\n")); + return false; /* fail */ } } diff --git a/bacula/src/dird/jobq.c b/bacula/src/dird/jobq.c index 7ceeb86f3e..a94235a234 100644 --- a/bacula/src/dird/jobq.c +++ b/bacula/src/dird/jobq.c @@ -622,7 +622,8 @@ static bool reschedule_job(JCR *jcr, jobq_t *jq, jobq_item_t *je) resched = /* Check for incomplete jobs */ (jcr->job->RescheduleIncompleteJobs && - jcr->is_incomplete() && jcr->is_JobType(JT_BACKUP)) || + jcr->is_incomplete() && jcr->is_JobType(JT_BACKUP) && + !jcr->is_JobLevel(L_BASE)) || /* Check for failed jobs */ (jcr->job->RescheduleOnError && !jcr->is_JobStatus(JS_Terminated) && diff --git a/bacula/src/stored/append.c b/bacula/src/stored/append.c index 8cdc8b42d8..72bf6ab1ac 100644 --- a/bacula/src/stored/append.c +++ b/bacula/src/stored/append.c @@ -55,9 +55,10 @@ void possible_incomplete_job(JCR *jcr, int32_t last_file_index) * for a production system, we probably want something like * 100-1000 files, and some number of bytes of data. * - * ****FIXME**** update this + * ****FIXME**** set last_file_index to something more + * reasonable, and maybe check JobBytes. */ - if (last_file_index > 10) { + if (jcr->spool_attributes && last_file_index > 10) { jcr->setJobStatus(JS_Incomplete); } }