]> git.sur5r.net Git - bacula/bacula/commitdiff
Add MaximumConcurrentReadJobs directive to Storage resource
authorKern Sibbald <kern@sibbald.com>
Fri, 14 Sep 2012 20:49:13 +0000 (22:49 +0200)
committerKern Sibbald <kern@sibbald.com>
Sat, 20 Apr 2013 12:50:59 +0000 (14:50 +0200)
bacula/src/dird/dird_conf.c
bacula/src/dird/dird_conf.h
bacula/src/dird/jobq.c

index 2f2eb000d28ff2904ba3913aa16a7e3b0815e971..4e6d690577b40c6ece0e87a8711aba9c2e4936ed 100644 (file)
@@ -224,6 +224,7 @@ static RES_ITEM store_items[] = {
    {"allowcompression",  store_bool, ITEM(res_store.AllowCompress), 0, ITEM_DEFAULT, true},
    {"heartbeatinterval", store_time, ITEM(res_store.heartbeat_interval), 0, ITEM_DEFAULT, 0},
    {"maximumconcurrentjobs", store_pint32, ITEM(res_store.MaxConcurrentJobs), 0, ITEM_DEFAULT, 1},
+   {"maximumconcurrentreadjobs", store_pint32, ITEM(res_store.MaxConcurrentReadJobs), 0, ITEM_DEFAULT, 0},
    {"sddport", store_pint32, ITEM(res_store.SDDport), 0, 0, 0}, /* deprecated */
    {"tlsauthenticate",      store_bool,      ITEM(res_store.tls_authenticate), 0, 0, 0},
    {"tlsenable",            store_bool,      ITEM(res_store.tls_enable), 0, 0, 0},
index 0a9d26cafba2f3b0a1e628e81c17c1345b908e0b..952578127f30f9fbca875ef1c5d888d66bf02bfb 100644 (file)
@@ -294,6 +294,7 @@ public:
    char *media_type;
    alist *device;                     /* Alternate devices for this Storage */
    int32_t MaxConcurrentJobs;         /* Maximum concurrent jobs */
+   int32_t MaxConcurrentReadJobs;     /* Maximum concurrent jobs reading */
    int32_t NumConcurrentJobs;         /* number of concurrent jobs running */
    int32_t NumConcurrentReadJobs;     /* number of jobs reading */
    char *tls_ca_certfile;             /* TLS CA Certificate File */
index 10a4ccdc9ceb8131c410337c2d40fa1c5ff9c876..5c79d78e457155af8f2426d9276391eb9837ab5a 100644 (file)
@@ -809,7 +809,10 @@ static pthread_mutex_t rstore_mutex = PTHREAD_MUTEX_INITIALIZER;
 bool inc_read_store(JCR *jcr)
 {
    P(rstore_mutex);
-   if (jcr->rstore->NumConcurrentJobs < jcr->rstore->MaxConcurrentJobs) {
+   if (jcr->rstore->NumConcurrentJobs < jcr->rstore->MaxConcurrentJobs &&
+       (jcr->getJobType() == JT_RESTORE ||
+        jcr->rstore->MaxConcurrentReadJobs == 0 ||
+        jcr->rstore->NumConcurrentReadJobs < jcr->rstore->MaxConcurrentReadJobs)) {
       jcr->rstore->NumConcurrentReadJobs++;
       jcr->rstore->NumConcurrentJobs++;
       Dmsg1(200, "Inc rncj=%d\n", jcr->rstore->NumConcurrentJobs);