From 9a0d387a0e36d8050cf210c17f1e508c8fba15b8 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Mon, 10 Aug 2009 14:17:33 +0200 Subject: [PATCH] Implement MaximumConcurrentJobs for SD devices --- bacula/src/stored/dev.c | 1 + bacula/src/stored/dev.h | 3 ++- bacula/src/stored/reserve.c | 10 ++++++++++ bacula/src/stored/stored_conf.c | 3 ++- bacula/src/stored/stored_conf.h | 3 ++- bacula/technotes | 13 ++++++++----- 6 files changed, 25 insertions(+), 8 deletions(-) diff --git a/bacula/src/stored/dev.c b/bacula/src/stored/dev.c index 98aa584f72..d17c17f018 100644 --- a/bacula/src/stored/dev.c +++ b/bacula/src/stored/dev.c @@ -160,6 +160,7 @@ init_dev(JCR *jcr, DEVRES *device) dev->max_block_size = device->max_block_size; dev->max_volume_size = device->max_volume_size; dev->max_file_size = device->max_file_size; + dev->max_concurrent_jobs = device->max_concurrent_jobs; dev->volume_capacity = device->volume_capacity; dev->max_rewind_wait = device->max_rewind_wait; dev->max_open_wait = device->max_open_wait; diff --git a/bacula/src/stored/dev.h b/bacula/src/stored/dev.h index 8c044f0003..b0424b4306 100644 --- a/bacula/src/stored/dev.h +++ b/bacula/src/stored/dev.h @@ -1,7 +1,7 @@ /* Bacula® - The Network Backup Solution - Copyright (C) 2000-2008 Free Software Foundation Europe e.V. + Copyright (C) 2000-2009 Free Software Foundation Europe e.V. The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. @@ -252,6 +252,7 @@ public: uint32_t max_block_size; /* max block size */ uint64_t max_volume_size; /* max bytes to put on one volume */ uint64_t max_file_size; /* max file size to put in one file on volume */ + uint64_t max_concurrent_jobs; /* maximum simultaneous jobs this drive */ uint64_t volume_capacity; /* advisory capacity */ uint64_t max_spool_size; /* maximum spool file size */ uint64_t spool_size; /* current spool size for this device */ diff --git a/bacula/src/stored/reserve.c b/bacula/src/stored/reserve.c index c2377d8f0d..742c9b512b 100644 --- a/bacula/src/stored/reserve.c +++ b/bacula/src/stored/reserve.c @@ -886,6 +886,16 @@ static bool is_max_jobs_ok(DCR *dcr) dcr->VolCatInfo.VolCatJobs, dev->num_reserved(), dcr->VolCatInfo.VolCatStatus, dcr->VolumeName); + /* Limit max concurrent jobs on this drive */ + if (dev->max_concurrent_jobs > 0 && dev->max_concurrent_jobs <= + (uint32_t)(dev->num_writers + dev->num_reserved())) { + /* Max Concurrent Jobs depassed or already reserved */ + Mmsg(jcr->errmsg, _("3609 JobId=%u Max concurrent jobs exceeded on drive %s.\n"), + (uint32_t)jcr->JobId, dev->print_name()); + queue_reserve_message(jcr); + Dmsg1(dbglvl, "reserve dev failed: %s", jcr->errmsg); + return false; + } if (strcmp(dcr->VolCatInfo.VolCatStatus, "Recycle") == 0) { return true; } diff --git a/bacula/src/stored/stored_conf.c b/bacula/src/stored/stored_conf.c index 79153ab836..19bfec3720 100644 --- a/bacula/src/stored/stored_conf.c +++ b/bacula/src/stored/stored_conf.c @@ -1,7 +1,7 @@ /* Bacula® - The Network Backup Solution - Copyright (C) 2000-2008 Free Software Foundation Europe e.V. + Copyright (C) 2000-2009 Free Software Foundation Europe e.V. The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. @@ -157,6 +157,7 @@ static RES_ITEM dev_items[] = { {"maximumvolumesize", store_size, ITEM(res_dev.max_volume_size), 0, 0, 0}, {"maximumfilesize", store_size, ITEM(res_dev.max_file_size), 0, ITEM_DEFAULT, 1000000000}, {"volumecapacity", store_size, ITEM(res_dev.volume_capacity), 0, 0, 0}, + {"maximumconcurrentjobs", store_pint32, ITEM(res_dev.max_concurrent_jobs), 0, 0, 0}, {"spooldirectory", store_dir, ITEM(res_dev.spool_directory), 0, 0, 0}, {"maximumspoolsize", store_size, ITEM(res_dev.max_spool_size), 0, 0, 0}, {"maximumjobspoolsize", store_size, ITEM(res_dev.max_job_spool_size), 0, 0, 0}, diff --git a/bacula/src/stored/stored_conf.h b/bacula/src/stored/stored_conf.h index 2f4f5d9134..7972f80c68 100644 --- a/bacula/src/stored/stored_conf.h +++ b/bacula/src/stored/stored_conf.h @@ -1,7 +1,7 @@ /* Bacula® - The Network Backup Solution - Copyright (C) 2000-2007 Free Software Foundation Europe e.V. + Copyright (C) 2000-2009 Free Software Foundation Europe e.V. The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. @@ -137,6 +137,7 @@ public: uint32_t max_block_size; /* max block size */ uint32_t max_volume_jobs; /* max jobs to put on one volume */ uint32_t max_network_buffer_size; /* max network buf size */ + uint32_t max_concurrent_jobs; /* maximum concurrent jobs this drive */ utime_t vol_poll_interval; /* interval between polling volume during mount */ int64_t max_volume_files; /* max files to put on one volume */ int64_t max_volume_size; /* max bytes to put on one volume */ diff --git a/bacula/technotes b/bacula/technotes index 2d2a041dda..5fd7de5756 100644 --- a/bacula/technotes +++ b/bacula/technotes @@ -2,6 +2,9 @@ General: +10Aug09 +kes Implement MaximumConcurrentJobs for SD devices. + This should significantly help spread jobs among different drives. 09Aug09 kes Fix bug #1344 show pool displayed wrong variable for maxvolbytes kes Fix compiler warnings in acl and xattr code @@ -30,17 +33,17 @@ kes Remove installing gconsole start script from Makefile.in 01Aug09 ebl Add Job Info panel to bat 30Jul09 -ebl Add restore from multiple storage functionnality with +ebl Add restore from multiple storage functionality with a part of Graham's patch. kes Add 'show disabled' command that lists the disabled jobs. kes Modify enable/disable commands to show only appropriate Jobs. 29Jul09 -kes Add ACL check for client in estimate commande +kes Add ACL check for client in estimate command ebl Change time_t by utime_t in accurate function kes Start reworking 3.0.2 bacula.spec file - Add SuSE build codes - Add depkgs-qt so bat can build on any system - - Reoganize defines + - Reorganize defines 26Jul09 kes Tweak RedHat spec files 24Jul09 @@ -90,7 +93,7 @@ ebl Implement the project 'restore' menu: enter a JobId, automatically ebl Should fix #1323 about verify accurate jobs and deleted files. 13Jul09 kes Send bootstrap directly from DIR to SD -kes Create build scripts for Win64 somewhat equilavent to the Win32 ones. +kes Create build scripts for Win64 somewhat equivalent to the Win32 ones. 10Jul09 ebl Print correct JobId in bls, should fix #1331 kes Apply python detect patch from Bastian Friedrich @@ -106,7 +109,7 @@ mvw Call acl and xattr function only when requested for fileset mvw Fix typo introduces by fix for bug #1305 03Jul09 ebl Should fix the first part #1323 about the restore option - 'List Jobs where a given File is saved' wich display deleted files + 'List Jobs where a given File is saved' which display deleted files 02Jul09 kes Another fix for bug #1311 to get the correct last_full_time ebl Make estimate command accurate compatible. Should fix #1318 -- 2.39.5