From 70d4a6b68fc2a98fc82ec6277676aafc994a085d Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Fri, 10 Oct 2003 08:03:29 +0000 Subject: [PATCH] Don't prune current job along with orphanned jobs git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@741 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/ChangeLog | 17 ++++++++++++++++- bacula/ReleaseNotes | 15 +++++++++++---- bacula/kernstodo | 1 + bacula/src/dird/sql_cmds.c | 6 ++++-- bacula/src/dird/ua_prune.c | 6 +++--- bacula/src/version.h | 4 ++-- 6 files changed, 37 insertions(+), 12 deletions(-) diff --git a/bacula/ChangeLog b/bacula/ChangeLog index a92ea98349..a3d3462278 100644 --- a/bacula/ChangeLog +++ b/bacula/ChangeLog @@ -1,5 +1,20 @@ -2003-10-09 Version 1.32b 08Oct03 Release +2003-10-10 Version 1.32b 10Oct03 Release +10Oct03 +- When pruning, select only old orphanned jobs to delete so that + the current job is not pruned too. +09Oct03 +- Corrected return status for bsf_dev and bsr_dev in block.c and btape.c +- dev.c used incorrect ruturn status for bsf_dev in the BSF at EOM + code. This caused all appends on FreeBSD to fail. +- Turn on fast block rejection code. +08Oct03 +- Optimize file index searches by adding a count to the bootstrap. +- Write single files/blocks to bootstrap without the second part. +- Add current Volume status to the cannot use this Volume message. +- Zero the rx->bsr in ua_restore when freeing so it doesn't get + freed twice. +- Lots of testing on the restore - I noticed that SD and FD bootstrap files were not always deleted, so delete them as soon as possible. - Restore by file (or by selecting files) created some diff --git a/bacula/ReleaseNotes b/bacula/ReleaseNotes index 1d49b40034..795793a1f8 100644 --- a/bacula/ReleaseNotes +++ b/bacula/ReleaseNotes @@ -1,9 +1,16 @@ - Release Notes for Bacula 1.32a + Release Notes for Bacula 1.32b - Bacula code: Total files = 259 Total lines = 77,873 (*.h *.c *.in) + Bacula code: Total files = 259 Total lines = 77,984 (*.h *.c *.in) -Major Changes this Release: +Changes since 1.32a: +- Improve forward space file/block during restore, many + optimizations. +- Fix a bug that did not allow appending to a tape + on FreeBSD systems. + + +Major Changes 1.32a Release: - Implemented forward space file/block whenever possible during restore. Restoring a small number of files is now much faster. @@ -28,7 +35,7 @@ Major Changes this Release: resource. -Other Changes this Release: +Other Changes 1.32a Release: - Fixed sparse file bug. - A warning message is sent when a job starts that will be blocked because the user did an "unmount". diff --git a/bacula/kernstodo b/bacula/kernstodo index d563ae8468..6fc22c57a3 100644 --- a/bacula/kernstodo +++ b/bacula/kernstodo @@ -23,6 +23,7 @@ Testing to do: (painful) - Figure out how to use ssh or stunnel to protect Bacula communications. For 1.33 Testing/Documentation: +- bextract is sending everything to the log file ****FIXME**** - Document to start higher priorty jobs before lower ones. - suppress "Do not forget to mount the drive!!!" if error - Document new records in Director. SDAddress SDDeviceName, SDPassword. diff --git a/bacula/src/dird/sql_cmds.c b/bacula/src/dird/sql_cmds.c index ce8e774cc7..b7f2836264 100644 --- a/bacula/src/dird/sql_cmds.c +++ b/bacula/src/dird/sql_cmds.c @@ -85,12 +85,14 @@ char *insert_delcand = /* Select Jobs from the DelCandidates table that have a * more recent backup -- i.e. are not the only backup. * This is the list of Jobs to delete for a Backup Job. + * At the same time, we select "orphanned" jobs + * (i.e. no files, ...) for deletion. */ char *select_backup_del = "SELECT DelCandidates.JobId " "FROM Job,DelCandidates " - "WHERE (DelCandidates.JobFiles=0) OR " - "(DelCandidates.JobStatus!='T') OR " + "WHERE (JobTDate<%s AND ((DelCandidates.JobFiles=0) OR " + "(DelCandidates.JobStatus!='T'))) OR " "(Job.JobTDate>%s " "AND Job.ClientId=%u " "AND Job.Type='B' " diff --git a/bacula/src/dird/ua_prune.c b/bacula/src/dird/ua_prune.c index cd6684a3f1..2278405d80 100644 --- a/bacula/src/dird/ua_prune.c +++ b/bacula/src/dird/ua_prune.c @@ -270,7 +270,7 @@ int prune_files(UAContext *ua, CLIENT *client) del.JobId = (JobId_t *)malloc(sizeof(JobId_t) * del.max_ids); - /* Now process same set but making delete list */ + /* Now process same set but making a delete list */ db_sql_query(ua->db, query, file_delete_handler, (void *)&del); for (i=0; i < del.num_ids; i++) { @@ -286,7 +286,7 @@ int prune_files(UAContext *ua, CLIENT *client) * Now mark Job as having files purged. This is necessary to * avoid having too many Jobs to process in future prunings. If * we don't do this, the number of JobId's in our in memory list - * will grow very large. + * could grow very large. */ Mmsg(&query, upd_Purged, del.JobId[i]); db_sql_query(ua->db, query, NULL, (void *)NULL); @@ -415,7 +415,7 @@ int prune_jobs(UAContext *ua, CLIENT *client, int JobType) switch (JobType) { case JT_ADMIN: case JT_BACKUP: - Mmsg(&query, select_backup_del, ed1, cr.ClientId); + Mmsg(&query, select_backup_del, ed1, ed1, cr.ClientId); break; case JT_RESTORE: Mmsg(&query, select_restore_del, ed1, cr.ClientId); diff --git a/bacula/src/version.h b/bacula/src/version.h index 977a839edb..225618e808 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -2,8 +2,8 @@ #undef VERSION #define VERSION "1.32b" #define VSTRING "1" -#define BDATE "09 Oct 2003" -#define LSMDATE "09Oct03" +#define BDATE "10 Oct 2003" +#define LSMDATE "10Oct03" /* Debug flags */ #undef DEBUG -- 2.39.5