From 2d7f14816bf6d040014e7358c54dc4421286d040 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sat, 6 Oct 2007 12:49:33 +0000 Subject: [PATCH] Add new SD despooling attributes and Dir inserting attributes job status codes. This fixes bug 961. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/branches/Branch-2.2@5735 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/cats/sql_create.c | 9 ++++++++- bacula/src/jcr.h | 2 ++ bacula/src/lib/util.c | 6 ++++++ bacula/src/stored/spool.c | 2 ++ bacula/src/version.h | 4 ++-- bacula/technotes-2.1 | 2 ++ 6 files changed, 22 insertions(+), 3 deletions(-) diff --git a/bacula/src/cats/sql_create.c b/bacula/src/cats/sql_create.c index 8ea820b36a..8ffba95043 100644 --- a/bacula/src/cats/sql_create.c +++ b/bacula/src/cats/sql_create.c @@ -754,22 +754,28 @@ bool my_batch_end(JCR *jcr, B_DB *mdb, const char *error) */ bool db_write_batch_file_records(JCR *jcr) { + int JobStatus = jcr->JobStatus; + if (!jcr->db_batch) { /* no files to backup ? */ Dmsg0(50,"db_create_file_record : no files\n"); return true; } + if (job_canceled(jcr)) { + return false; + } Dmsg1(50,"db_create_file_record changes=%u\n",jcr->db_batch->changes); + jcr->JobStatus = JS_AttrInserting; if (!sql_batch_end(jcr, jcr->db_batch, NULL)) { Jmsg(jcr, M_FATAL, 0, "Bad batch end %s\n", jcr->db_batch->errmsg); return false; } - if (job_canceled(jcr)) { return false; } + /* we have to lock tables */ if (!db_sql_query(jcr->db_batch, sql_batch_lock_path_query, NULL, NULL)) { Jmsg(jcr, M_FATAL, 0, "Can't lock Path table %s\n", jcr->db_batch->errmsg); @@ -819,6 +825,7 @@ bool db_write_batch_file_records(JCR *jcr) db_sql_query(jcr->db_batch, "DROP TABLE batch", NULL,NULL); + jcr->JobStatus = JobStatus; /* reset entry status */ return true; } diff --git a/bacula/src/jcr.h b/bacula/src/jcr.h index ad28b3485c..8812594861 100644 --- a/bacula/src/jcr.h +++ b/bacula/src/jcr.h @@ -87,6 +87,8 @@ #define JS_WaitMaxJobs 'd' /* Waiting for maximum jobs */ #define JS_WaitStartTime 't' /* Waiting for start time */ #define JS_WaitPriority 'p' /* Waiting for higher priority jobs to finish */ +#define JS_AttrDespooling 'a' /* SD despooling attributes */ +#define JS_AttrInserting 'i' /* Doing batch insert file records */ /* Migration selection types */ enum { diff --git a/bacula/src/lib/util.c b/bacula/src/lib/util.c index 50844211eb..f1560a8cc9 100644 --- a/bacula/src/lib/util.c +++ b/bacula/src/lib/util.c @@ -230,6 +230,12 @@ void jobstatus_to_ascii(int JobStatus, char *msg, int maxlen) case JS_WaitPriority: jobstat = _("Waiting on Priority"); break; + case JS_AttrDespooling: + jobstat = _("SD despooling Attributes"); + break; + case JS_AttrInserting: + jobstat = _("Dir inserting Attributes"); + break; default: if (JobStatus == 0) { diff --git a/bacula/src/stored/spool.c b/bacula/src/stored/spool.c index e86672efb2..25eb7c12d5 100644 --- a/bacula/src/stored/spool.c +++ b/bacula/src/stored/spool.c @@ -631,6 +631,8 @@ bool commit_attribute_spool(JCR *jcr) } spool_stats.attr_size += size; V(mutex); + set_jcr_job_status(jcr, JS_AttrDespooling); + dir_send_job_status(jcr); Jmsg(jcr, M_INFO, 0, _("Sending spooled attrs to the Director. Despooling %s bytes ...\n"), edit_uint64_with_commas(size, ec1)); jcr->dir_bsock->despool(update_attr_spool_size, size); diff --git a/bacula/src/version.h b/bacula/src/version.h index 58ac0e4d1a..b33282abf5 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -4,8 +4,8 @@ #undef VERSION #define VERSION "2.2.5" -#define BDATE "04 October 2007" -#define LSMDATE "04Oct07" +#define BDATE "06 October 2007" +#define LSMDATE "06Oct07" #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 93d144178a..4c8e8c5b5e 100644 --- a/bacula/technotes-2.1 +++ b/bacula/technotes-2.1 @@ -1,6 +1,8 @@ Technical notes on version 2.2 General: +kes Add new SD despooling attributes and Dir inserting attributes + job status codes. This fixes bug 961. 06Oct07 kes Fix Win32 drive display in bat version browser. Fixes bug #962. 05Oct07 -- 2.39.2