From 9e58a202b2a6dc549f294b37373ef397d6151b6a Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Wed, 7 May 2008 19:18:32 +0000 Subject: [PATCH] kes Improve SD reserve debug code. kes Testing an improvement to free up volumes no longer in use. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@6909 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/stored/acquire.c | 7 ++++++- bacula/src/stored/askdir.c | 4 +++- bacula/src/stored/protos.h | 1 + bacula/src/stored/reserve.c | 2 +- bacula/src/version.h | 4 ++-- bacula/technotes-2.3 | 3 +++ 6 files changed, 16 insertions(+), 5 deletions(-) diff --git a/bacula/src/stored/acquire.c b/bacula/src/stored/acquire.c index 1d0d8a4ed3..63c784c505 100644 --- a/bacula/src/stored/acquire.c +++ b/bacula/src/stored/acquire.c @@ -492,7 +492,8 @@ bool release_device(DCR *dcr) Dmsg2(200, "dir_update_vol_info. Release vol=%s dev=%s\n", dev->VolCatInfo.VolCatName, dev->print_name()); } - if (!dev->is_busy()) { /* if not being used */ + if (dev->num_writers == 0) { /* if not being used */ +// if (!dev->is_busy()) { /* if not being used */ volume_unused(dcr); /* we obviously are not using the volume */ } } @@ -506,6 +507,10 @@ bool release_device(DCR *dcr) volume_unused(dcr); } unlock_volumes(); + Dmsg3(100, "%d writers, %d reserve, dev=%s\n", dev->num_writers, dev->num_reserved(), + dev->print_name()); + debug_list_volumes("acquire:release_device()"); + /* If no writers, close if file or !CAP_ALWAYS_OPEN */ if (dev->num_writers == 0 && (!dev->is_tape() || !dev->has_cap(CAP_ALWAYSOPEN))) { diff --git a/bacula/src/stored/askdir.c b/bacula/src/stored/askdir.c index cf23a4fd9a..3b83ca961f 100644 --- a/bacula/src/stored/askdir.c +++ b/bacula/src/stored/askdir.c @@ -498,7 +498,7 @@ bool dir_ask_sysop_to_create_appendable_volume(DCR *dcr) return true; } else { if (stat == W_TIMEOUT || stat == W_MOUNT) { - Jmsg(jcr, M_MOUNT, 0, _( + Mmsg(dev->errmsg, _( "Job %s waiting. Cannot find any appendable volumes.\n" "Please use the \"label\" command to create a new Volume for:\n" " Storage: %s\n" @@ -509,6 +509,8 @@ bool dir_ask_sysop_to_create_appendable_volume(DCR *dcr) dcr->pool_name, dcr->media_type); } + Jmsg(jcr, M_MOUNT, 0, "%s", dev->errmsg); + Dmsg1(100, "%s", dev->errmsg); } set_jcr_job_status(jcr, JS_WaitMedia); diff --git a/bacula/src/stored/protos.h b/bacula/src/stored/protos.h index ef8ebc09f8..f666c6fd8b 100644 --- a/bacula/src/stored/protos.h +++ b/bacula/src/stored/protos.h @@ -231,6 +231,7 @@ void send_drive_reserve_messages(JCR *jcr, void sendit(const char *msg, int l bool find_suitable_device_for_job(JCR *jcr, RCTX &rctx); int search_res_for_device(RCTX &rctx); void release_reserve_messages(JCR *jcr); +void debug_list_volumes(const char *imsg); extern int reservations_lock_count; extern int vol_list_lock_count; diff --git a/bacula/src/stored/reserve.c b/bacula/src/stored/reserve.c index 050c606bb2..2acc5bd330 100644 --- a/bacula/src/stored/reserve.c +++ b/bacula/src/stored/reserve.c @@ -170,7 +170,7 @@ enum { debug_nolock = false }; -static void debug_list_volumes(const char *imsg) +void debug_list_volumes(const char *imsg) { VOLRES *vol; POOL_MEM msg(PM_MESSAGE); diff --git a/bacula/src/version.h b/bacula/src/version.h index 99fe973ac7..bdca238582 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -4,8 +4,8 @@ #undef VERSION #define VERSION "2.3.20" -#define BDATE "03 May 2008" -#define LSMDATE "03May08" +#define BDATE "07 May 2008" +#define LSMDATE "07May08" #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 58053cd53d..113f535ec1 100644 --- a/bacula/technotes-2.3 +++ b/bacula/technotes-2.3 @@ -24,6 +24,9 @@ Add long term statistics job table General: +07May08 +kes Improve SD reserve debug code. +kes Testing an improvement to free up volumes no longer in use. 03May08 kes Rework SD acquire for read to handle autochanger Volume swapping. -- 2.39.5