]> git.sur5r.net Git - bacula/bacula/commitdiff
Add new SD despooling attributes and Dir inserting attributes
authorKern Sibbald <kern@sibbald.com>
Sat, 6 Oct 2007 12:49:33 +0000 (12:49 +0000)
committerKern Sibbald <kern@sibbald.com>
Sat, 6 Oct 2007 12:49:33 +0000 (12:49 +0000)
     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
bacula/src/jcr.h
bacula/src/lib/util.c
bacula/src/stored/spool.c
bacula/src/version.h
bacula/technotes-2.1

index 8ea820b36afa4689ebc743893099f6159cb0aa26..8ffba95043b5a98dffcef1e49edc1ac25fdfcef8 100644 (file)
@@ -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;
 }
 
index ad28b3485cdb63f760a1b06483053d0e8199469f..88125948615b828fc9093674af375a32192ad532 100644 (file)
@@ -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 {
index 50844211ebb921c9389b5a74d288fbc8a396db20..f1560a8cc9a216172f962b022c7f2ea2c46bcb5a 100644 (file)
@@ -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) {
index e86672efb2ee66e27a4cb64807962cc713c6bcd7..25eb7c12d54047a3d3a4ef5fd0dfbfe42ca5f2f9 100644 (file)
@@ -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);
index 58ac0e4d1a7a243284fe3721a52a2195b0d41928..b33282abf542698767f5b0a30491cb618980d2d7 100644 (file)
@@ -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 */
index 93d144178a9d2bde421145ac88ce50167f0fbca7..4c8e8c5b5e82802a969c5be37eaabd57c30f3d01 100644 (file)
@@ -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