From 3ff62417e9ad1269a6c3bffce6eaa532b04f24af Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sun, 17 Feb 2008 12:33:42 +0000 Subject: [PATCH] Apply Max Full Age patch submitted by Scott Bailey git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@6437 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/AUTHORS | 1 + bacula/ReleaseNotes | 2 +- bacula/src/dird/dird_conf.c | 1 + bacula/src/dird/dird_conf.h | 1 + bacula/src/dird/fd_cmds.c | 13 +++++++++++-- bacula/src/version.h | 4 ++-- bacula/technotes-2.3 | 3 +++ 7 files changed, 20 insertions(+), 5 deletions(-) diff --git a/bacula/AUTHORS b/bacula/AUTHORS index 79964805d0..20218a0852 100644 --- a/bacula/AUTHORS +++ b/bacula/AUTHORS @@ -81,6 +81,7 @@ Richard Mortimer Robert Nelson Rudolf Cejka Russel Howe +Scott Bailey Sergey Svishchev Thomas Glatthor Thorsten Enge diff --git a/bacula/ReleaseNotes b/bacula/ReleaseNotes index 7be316919f..2a434bb4dc 100644 --- a/bacula/ReleaseNotes +++ b/bacula/ReleaseNotes @@ -1,7 +1,7 @@ Release Notes for Bacula 2.2.2 - Bacula code: Total files = 520 Total lines = 195,550 (*.h *.c *.in) + Bacula code: Total files = 506 Total lines = 190,209 (*.h *.c *.in) 82 new files, 41,221 new lines of code, 208,380 lines of change from 2.0.3 This Director and Storage daemon must be upgraded at the same time, diff --git a/bacula/src/dird/dird_conf.c b/bacula/src/dird/dird_conf.c index b9d5ab1591..e85d189561 100644 --- a/bacula/src/dird/dird_conf.c +++ b/bacula/src/dird/dird_conf.c @@ -293,6 +293,7 @@ RES_ITEM job_items[] = { {"differentialmaxwaittime", store_time, ITEM(res_job.DiffMaxWaitTime), 0, 0, 0}, {"maxwaittime", store_time, ITEM(res_job.MaxWaitTime), 0, 0, 0}, {"maxstartdelay",store_time, ITEM(res_job.MaxStartDelay), 0, 0, 0}, + {"maxfullage", store_time, ITEM(res_job.MaxFullAge), 0, 0, 0}, {"jobretention", store_time, ITEM(res_job.JobRetention), 0, 0, 0}, {"prefixlinks", store_bool, ITEM(res_job.PrefixLinks), 0, ITEM_DEFAULT, false}, {"prunejobs", store_bool, ITEM(res_job.PruneJobs), 0, ITEM_DEFAULT, false}, diff --git a/bacula/src/dird/dird_conf.h b/bacula/src/dird/dird_conf.h index cdd0f0e871..dc7be31305 100644 --- a/bacula/src/dird/dird_conf.h +++ b/bacula/src/dird/dird_conf.h @@ -385,6 +385,7 @@ public: utime_t MaxStartDelay; /* max start delay in seconds */ utime_t RescheduleInterval; /* Reschedule interval */ utime_t JobRetention; /* job retention period in seconds */ + utime_t MaxFullAge; /* Max age of full to avoid upgrade */ uint32_t MaxConcurrentJobs; /* Maximum concurrent jobs */ int64_t spool_size; /* Size of spool file for this job */ int RescheduleTimes; /* Number of times to reschedule job */ diff --git a/bacula/src/dird/fd_cmds.c b/bacula/src/dird/fd_cmds.c index ffe312c16d..cdb1632562 100644 --- a/bacula/src/dird/fd_cmds.c +++ b/bacula/src/dird/fd_cmds.c @@ -161,6 +161,8 @@ int connect_to_file_daemon(JCR *jcr, int retry_interval, int max_retry_time, void get_level_since_time(JCR *jcr, char *since, int since_len) { int JobLevel; + bool FullOk; + utime_t now, LastFull; since[0] = 0; /* If job cloned and a since time already given, use it */ @@ -182,8 +184,15 @@ void get_level_since_time(JCR *jcr, char *since, int since_len) case L_INCREMENTAL: /* Look up start time of last job */ jcr->jr.JobId = 0; /* flag for db_find_job_start time */ - if (!db_find_job_start_time(jcr, jcr->db, &jcr->jr, &jcr->stime)) { - /* No job found, so upgrade this one to Full */ + FullOk = db_find_job_start_time(jcr, jcr->db, &jcr->jr, &jcr->stime); + /* If there was a successful job, make sure it is recent enough */ + if (FullOk && jcr->job->MaxFullAge > 0) { + now = btime_to_utime(get_current_btime()); + LastFull = str_to_utime(jcr->stime); + FullOk = ((now - LastFull) < jcr->job->MaxFullAge); + } + if (!FullOk) { + /* No recent job found, so upgrade this one to Full */ Jmsg(jcr, M_INFO, 0, "%s", db_strerror(jcr->db)); Jmsg(jcr, M_INFO, 0, _("No prior or suitable Full backup found in catalog. Doing FULL backup.\n")); bsnprintf(since, since_len, _(" (upgraded from %s)"), diff --git a/bacula/src/version.h b/bacula/src/version.h index 0d9c0aa918..b905abc810 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -4,8 +4,8 @@ #undef VERSION #define VERSION "2.3.10" -#define BDATE "14 February 2008" -#define LSMDATE "14Feb08" +#define BDATE "16 February 2008" +#define LSMDATE "16Feb08" #define PROG_COPYRIGHT "Copyright (C) %d-2008 Free Software Foundation Europe e.V.\n" #define BYEAR "2008" /* year for copyright messages in progs */ diff --git a/bacula/technotes-2.3 b/bacula/technotes-2.3 index f5a2d06801..98179c9334 100644 --- a/bacula/technotes-2.3 +++ b/bacula/technotes-2.3 @@ -3,6 +3,9 @@ General: 17Feb08 kes Plugin debug code + tweak a couple bat dialog layouts +16Feb08 +kes Apply Max Full Age patch submitted by Scott Bailey + 14Feb08 kes Fix creating first JobMedia record during Migration to include proper index. This caused slow restores of migrated jobs. -- 2.39.5