From 5be06d2b08ee00f8a92bccf8d2ff3e329b7f12a9 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Fri, 9 May 2008 05:39:49 +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/branches/Branch-2.2@6923 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/stored/acquire.c | 5 ++++- 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.1 | 4 ++++ 6 files changed, 15 insertions(+), 5 deletions(-) diff --git a/bacula/src/stored/acquire.c b/bacula/src/stored/acquire.c index 1d0d8a4ed3..bf32057b9d 100644 --- a/bacula/src/stored/acquire.c +++ b/bacula/src/stored/acquire.c @@ -492,7 +492,7 @@ 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 */ volume_unused(dcr); /* we obviously are not using the volume */ } } @@ -506,6 +506,9 @@ 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..d67cd328eb 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" @@ -508,6 +508,8 @@ bool dir_ask_sysop_to_create_appendable_volume(DCR *dcr) dev->print_name(), dcr->pool_name, dcr->media_type); + Jmsg(jcr, M_MOUNT, 0, "%s", dev->errmsg); + Dmsg1(100, "%s", dev->errmsg); } } 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 ba918274b2..99de0a72f8 100644 --- a/bacula/src/stored/reserve.c +++ b/bacula/src/stored/reserve.c @@ -172,7 +172,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 92c8474c1c..2b5b28efa7 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -4,8 +4,8 @@ #undef VERSION #define VERSION "2.2.10-b2" -#define BDATE "07 May 2008" -#define LSMDATE "07May08" +#define BDATE "08 May 2008" +#define LSMDATE "08May08" #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.1 b/bacula/technotes-2.1 index fa58a26bd1..cb7f591218 100644 --- a/bacula/technotes-2.1 +++ b/bacula/technotes-2.1 @@ -2,6 +2,10 @@ General: +08May08 +kes Improve SD reserve debug code. +kes Testing an improvement to free up volumes no longer in use. + Beta Release Version 2.2.10-b2 07May08 03May08 -- 2.39.5