From f14d8740e42d4e9897ca31c52547b6ce286d77a0 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Thu, 12 Jul 2007 07:49:21 +0000 Subject: [PATCH] kes Make arguments to get_scratch_volume() in same order as other such calls. kes Rework the prune_volumes() subroutine so that after purging and no volume found in desired pool, it will check for a scratch volume. This prevents recycling the whole scratch pool. kes Add code to status storage to print boffset_t (largefile support). git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5144 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/ChangeLog | 23 +++++++++++++++++++++++ bacula/ReleaseNotes | 15 +++++++++++++-- bacula/src/dird/autoprune.c | 12 ++++++++++-- bacula/src/dird/next_vol.c | 7 ++----- bacula/src/dird/protos.h | 1 + bacula/src/stored/status.c | 4 ++++ bacula/src/version.h | 4 ++-- bacula/technotes-2.1 | 9 +++++++++ 8 files changed, 64 insertions(+), 11 deletions(-) diff --git a/bacula/ChangeLog b/bacula/ChangeLog index 78f07b43a0..6bff27a406 100644 --- a/bacula/ChangeLog +++ b/bacula/ChangeLog @@ -1,6 +1,29 @@ Technical notes on version 2.1 General: +12Jul07 +kes Make arguments to get_scratch_volume() in same order as other + such calls. +kes Rework the prune_volumes() subroutine so that after purging and + no volume found in desired pool, it will check for a scratch + volume. This prevents recycling the whole scratch pool. +kes Add code to status storage to print boffset_t (largefile support). +11Jul07 +kes Move qwt (Graphics libarary for Qt4) to depkgs. +kes You now need a --with-qwt= to be able to build bat. +kes Update src/win32/cats/bacula_cats.def to include the new + db_get_query_dbids() call on Win32. +07Jul07 +kes Correct a problem when selecting a scratch volume and moving + it to another pool that lost some columns. +kes Tweak some code in ua_update.c to use POOL_MEM instead of POOLMEM. +kes Enhance Autochanger error messages to include Volume and device name. +kes Rework prune_volumes() code to take account of InChanger flag, + and to handle recycling volumes going to the Scratch pool and + current pool because the RecyclePool directive. +kes Implement a better and more efficient db_get_query_dbids() to + handle creating and passing back a list of DBIds. + Release 2.1.24 beta 03Jul07 kes Start work on new more efficient DBId subroutine. First use diff --git a/bacula/ReleaseNotes b/bacula/ReleaseNotes index 9a1c9ceaec..aded884338 100644 --- a/bacula/ReleaseNotes +++ b/bacula/ReleaseNotes @@ -1,7 +1,7 @@ - Release Notes for Bacula 2.1.24 + Release Notes for Bacula 2.1.26 - Bacula code: Total files = 516 Total lines = 244,807 (*.h *.c *.in) + Bacula code: Total files = 516 Total lines = 244,888 (*.h *.c *.in) This Director and Storage daemon must be upgraded at the same time, but they should be compatible with all 2.0.x File daemons, unless you @@ -15,6 +15,17 @@ test before relying on it. It should backup and restore reparse points. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +Changes since Beta release 2.1.24 +- Add qwt graphics library (for Qt4) needed to build bat to the + depkgs-11Jul07.tar.gz package +- You now need a --with-qwt= to be able to build bat. +- Keep prune_volumes() from pruning the whole Scratch pool. +- More debug output in status storage. +- Correct moving a Scratch volume from pool to pool (some + critical columns were lost). +- New more efficient db_get_query_dbids() -- not yet implemented + everywhere, but currently used in volume pruning. + Changes since Beta release 2.1.22 - Different locking in reservations and despooling systems, which means more micro-locking and less macro-locking, which diff --git a/bacula/src/dird/autoprune.c b/bacula/src/dird/autoprune.c index 9a91eb44e7..df4cb5542d 100644 --- a/bacula/src/dird/autoprune.c +++ b/bacula/src/dird/autoprune.c @@ -190,9 +190,17 @@ bool prune_volumes(JCR *jcr, bool InChanger, MEDIA_DBR *mr) */ if (ok && lmr.PoolId == mr->PoolId) { Dmsg2(050, "Vol=%s MediaId=%d purged.\n", lmr.VolumeName, (int)lmr.MediaId); - mr = &lmr; /* struct copy */ - break; + mr = &lmr; /* struct copy */ + break; /* got a volume */ } + /* + * We purged something but did not get a volume in the current pool. + * It must be a scratch volume, so try to get it. + */ + if (ok && get_scratch_volume(jcr, InChanger, mr)) { + break; /* got a volume */ + } + ok = false; /* clear OK, in case we fall out */ } else { Dmsg2(050, "Nothing pruned MediaId=%d Volume=%s\n", (int)lmr.MediaId, lmr.VolumeName); } diff --git a/bacula/src/dird/next_vol.c b/bacula/src/dird/next_vol.c index 603db2af44..ed54ccf7e1 100644 --- a/bacula/src/dird/next_vol.c +++ b/bacula/src/dird/next_vol.c @@ -39,9 +39,6 @@ #include "bacula.h" #include "dird.h" -static bool get_scratch_volume(JCR *jcr, MEDIA_DBR *mr, bool InChanger); - - /* * Items needed: * mr.PoolId must be set @@ -105,7 +102,7 @@ int find_next_volume_for_append(JCR *jcr, MEDIA_DBR *mr, int index, /* * 5. Try pulling a volume from the Scratch pool */ - ok = get_scratch_volume(jcr, mr, InChanger); + ok = get_scratch_volume(jcr, InChanger, mr); } /* * If we are using an Autochanger and have not found @@ -328,7 +325,7 @@ void check_if_volume_valid_or_recyclable(JCR *jcr, MEDIA_DBR *mr, const char **r static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; -static bool get_scratch_volume(JCR *jcr, MEDIA_DBR *mr, bool InChanger) +bool get_scratch_volume(JCR *jcr, bool InChanger, MEDIA_DBR *mr) { MEDIA_DBR smr; POOL_DBR spr, pr; diff --git a/bacula/src/dird/protos.h b/bacula/src/dird/protos.h index 480abaa3a7..10d27e31eb 100644 --- a/bacula/src/dird/protos.h +++ b/bacula/src/dird/protos.h @@ -152,6 +152,7 @@ int find_next_volume_for_append(JCR *jcr, MEDIA_DBR *mr, int index, bool create, bool purge); bool has_volume_expired(JCR *jcr, MEDIA_DBR *mr); void check_if_volume_valid_or_recyclable(JCR *jcr, MEDIA_DBR *mr, const char **reason); +bool get_scratch_volume(JCR *jcr, bool InChanger, MEDIA_DBR *mr); /* newvol.c */ bool newVolume(JCR *jcr, MEDIA_DBR *mr); diff --git a/bacula/src/stored/status.c b/bacula/src/stored/status.c index 103822a1de..cd11dab528 100644 --- a/bacula/src/stored/status.c +++ b/bacula/src/stored/status.c @@ -94,6 +94,10 @@ void output_status(void sendit(const char *msg, int len, void *sarg), void *arg) edit_uint64_with_commas(sm_buffers, b4), edit_uint64_with_commas(sm_max_buffers, b5)); sendit(msg, len, arg); + len = Mmsg(msg, "Sizes: boffset_t=%d size_t=%d int32_t=%d int64_t=%d\n", + (int)sizeof(boffset_t), (int)sizeof(size_t), (int)sizeof(int32_t), + (int)sizeof(int64_t)); + sendit(msg, len, arg); /* * List running jobs diff --git a/bacula/src/version.h b/bacula/src/version.h index 9e4760fbb7..d2fd22d217 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -4,8 +4,8 @@ #undef VERSION #define VERSION "2.1.25" -#define BDATE "11 July 2007" -#define LSMDATE "11Jul07" +#define BDATE "12 July 2007" +#define LSMDATE "12Jul07" #define PROG_COPYRIGHT "Copyright (C) %d-2007 Free Software Foundation Europe e.V.\n" #define BYEAR "2007" /* year for copyright messages in progs */ diff --git a/bacula/technotes-2.1 b/bacula/technotes-2.1 index e26b9f3eb5..8f97ec5574 100644 --- a/bacula/technotes-2.1 +++ b/bacula/technotes-2.1 @@ -1,6 +1,13 @@ Technical notes on version 2.1 General: +12Jul07 +kes Make arguments to get_scratch_volume() in same order as other + such calls. +kes Rework the prune_volumes() subroutine so that after purging and + no volume found in desired pool, it will check for a scratch + volume. This prevents recycling the whole scratch pool. +kes Add code to status storage to print boffset_t (largefile support). 11Jul07 kes Move qwt (Graphics libarary for Qt4) to depkgs. kes You now need a --with-qwt= to be able to build bat. @@ -16,6 +23,8 @@ kes Rework prune_volumes() code to take account of InChanger flag, current pool because the RecyclePool directive. kes Implement a better and more efficient db_get_query_dbids() to handle creating and passing back a list of DBIds. + +Release 2.1.24 beta 03Jul07 kes Start work on new more efficient DBId subroutine. First use will be for recycling volume to Scratch inchanger. -- 2.39.2