]> git.sur5r.net Git - bacula/bacula/commitdiff
- Take Dan's fix to the fix_postgresql_tables (thanks Dan)
authorKern Sibbald <kern@sibbald.com>
Wed, 24 Nov 2004 17:16:58 +0000 (17:16 +0000)
committerKern Sibbald <kern@sibbald.com>
Wed, 24 Nov 2004 17:16:58 +0000 (17:16 +0000)
- Increase Maximum Concurrent Jobs to 20 in SD and FD!
- Fix improper handling of autochanger Volumes that are not
  marked InChanger.

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1718 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/kernstodo
bacula/patches/fix_postgresql_tables
bacula/src/cats/fix_postgresql_tables
bacula/src/filed/bacula-fd.conf.in
bacula/src/stored/bacula-sd.conf.in
bacula/src/stored/dircmd.c
bacula/src/version.h

index b8e483b48c81d9ebc68d523274de4674d103a621..683cd3a5fc35145bbfffaf76fd48190abb6f8c88 100644 (file)
@@ -25,6 +25,8 @@ For 1.36.1:
 
 
 1.37 Possibilities:
+- Document testing
+- Add performance testing hooks
 - if 2 concurrent backups are attempted on the same tape
   drive (autoloader) into different tape pools, one of them will exit
   fatally instead of halting until the drive is idle
@@ -998,4 +1000,3 @@ Block Position: 0
 - Fix CDROM make script to permit picking up already installed
   static FD.
 - Add date/time to each Jmsg.
-
index 4d835df68ee23894e22415988cfeaf333e7f963d..2d69f89278089a665e940680551d0948d23576d2 100755 (executable)
@@ -14,11 +14,15 @@ bindir=****EDIT-ME to be the path to psql****
 if $bindir/psql $* -f - <<END-OF-DATA
 \c bacula
 
-alter table media alter column endblock rename to endblock-old;
+begin;
+
+alter table media rename column endblock to endblock_old;
 alter table media add column endblock bigint;
-update media set endblock = endblock-old;
+update media set endblock = endblock_old;
 alter table media alter column endblock set not null;
-alter table media drop column endblock-old;
+alter table media drop column endblock_old;
+
+commit;
 
 vacuum;
 
index 4d835df68ee23894e22415988cfeaf333e7f963d..2d69f89278089a665e940680551d0948d23576d2 100755 (executable)
@@ -14,11 +14,15 @@ bindir=****EDIT-ME to be the path to psql****
 if $bindir/psql $* -f - <<END-OF-DATA
 \c bacula
 
-alter table media alter column endblock rename to endblock-old;
+begin;
+
+alter table media rename column endblock to endblock_old;
 alter table media add column endblock bigint;
-update media set endblock = endblock-old;
+update media set endblock = endblock_old;
 alter table media alter column endblock set not null;
-alter table media drop column endblock-old;
+alter table media drop column endblock_old;
+
+commit;
 
 vacuum;
 
index cb23806638929d39c472f470cc0bf4cd74f6fe3b..dd71f4c66058bde7aee9779e634abec9a4fcf3a3 100644 (file)
@@ -33,7 +33,7 @@ FileDaemon {                          # this is me
   FDport = @fd_port@                  # where we listen for the director
   WorkingDirectory = @working_dir@
   Pid Directory = @piddir@
-  Maximum Concurrent Jobs = 1
+  Maximum Concurrent Jobs = 20
 }
 
 # Send all messages except skipped files back to Director
index 1ad91aed555d0f388d4d4db14bfa30728fe30910..628576124737bffbd473e418b8769d37c4052ac2 100644 (file)
@@ -15,7 +15,7 @@ Storage {                             # definition of myself
   SDPort = @sd_port@                  # Director's port      
   WorkingDirectory = "@working_dir@"
   Pid Directory = "@piddir@"
-  Maximum Concurrent Jobs = 1
+  Maximum Concurrent Jobs = 20
 }
 
 #
index 8d7e136d6dd787eeb267e29ac351f616b20936c6..523d42baeb82fc1d4a583cee88818e67885de2c3 100644 (file)
@@ -78,6 +78,7 @@ static void read_volume_label(JCR *jcr, DEVICE *dev, int Slot);
 static void label_volume_if_ok(JCR *jcr, DEVICE *dev, char *oldname,
                               char *newname, char *poolname, 
                               int Slot, int relabel);
+static bool try_autoload_device(JCR *jcr, int slot, const char *VolName);
 
 struct s_cmds {
    const char *cmd;
@@ -373,21 +374,11 @@ static void label_volume_if_ok(JCR *jcr, DEVICE *dev, char *oldname,
    DCR *dcr = jcr->dcr;
    int label_status;
    
+   dcr->dev = dev;
    steal_device_lock(dev, &hold, BST_WRITING_LABEL);
    
-   bstrncpy(dcr->VolumeName, newname, sizeof(dcr->VolumeName));
-   dcr->VolCatInfo.Slot = slot;
-   if (autoload_device(dcr, 0, dir) < 0) {    /* autoload if possible */
-      goto bail_out;
-   }
-
-   /* Ensure that the device is open -- autoload_device() closes it */
-   for ( ; !(dev->state & ST_OPENED); ) {
-      if (open_dev(dev, dcr->VolumeName, OPEN_READ_WRITE) < 0) {
-         bnet_fsend(dir, _("3910 Unable to open device %s. ERR=%s\n"), 
-           dev_name(dev), strerror_dev(dev));
-        goto bail_out;
-      }
+   if (!try_autoload_device(jcr, slot, newname)) {
+      goto bail_out;                 /* error */
    }
 
    /* See what we have for a Volume */
@@ -845,22 +836,12 @@ static void read_volume_label(JCR *jcr, DEVICE *dev, int Slot)
    BSOCK *dir = jcr->dir_bsock;
    bsteal_lock_t hold;
    DCR *dcr = jcr->dcr;
-   
+
+   dcr->dev = dev;
    steal_device_lock(dev, &hold, BST_WRITING_LABEL);
    
-   dcr->VolumeName[0] = 0;
-   dcr->VolCatInfo.Slot = Slot;
-   if (autoload_device(dcr, 0, dir) < 0) {    /* autoload if possible */
-      goto bail_out;
-   }
-
-   /* Ensure that the device is open -- autoload_device() closes it */
-   for ( ; !dev_state(dev, ST_OPENED); ) {
-      if (open_dev(dev, dcr->VolumeName, OPEN_READ_WRITE) < 0) {
-         bnet_fsend(dir, _("3910 Unable to open device \"%s\". ERR=%s\n"), 
-           dev_name(dev), strerror_dev(dev));
-        goto bail_out;
-      }
+   if (!try_autoload_device(jcr, Slot, "")) {
+      goto bail_out;                 /* error */
    }
 
    dev->state &= ~ST_LABEL;          /* force read of label */
@@ -880,3 +861,27 @@ bail_out:
    give_back_device_lock(dev, &hold);
    return;
 }
+
+static bool try_autoload_device(JCR *jcr, int slot, const char *VolName)
+{
+   DCR *dcr = jcr->dcr;
+   BSOCK *dir = jcr->dir_bsock;
+   DEVICE *dev = dcr->dev;
+
+   bstrncpy(dcr->VolumeName, VolName, sizeof(dcr->VolumeName));
+   dcr->VolCatInfo.Slot = slot;
+   dcr->VolCatInfo.InChanger = slot > 0;
+   if (autoload_device(dcr, 0, dir) < 0) {    /* autoload if possible */
+      return false; 
+   }
+
+   /* Ensure that the device is open -- autoload_device() closes it */
+   for ( ; !(dev->state & ST_OPENED); ) {
+      if (open_dev(dev, dcr->VolumeName, OPEN_READ_WRITE) < 0) {
+         bnet_fsend(dir, _("3910 Unable to open device %s. ERR=%s\n"), 
+           dev_name(dev), strerror_dev(dev));
+        return false;
+      }
+   }
+   return true;
+}
index 3ee8d8a11ce5fcee1005d4453efb673a7d8f275e..7cc3d2a284b1e334760a7271e68227672bf6c7f3 100644 (file)
@@ -1,8 +1,8 @@
 /* */
 #undef  VERSION
 #define VERSION "1.36.1"
-#define BDATE   "22 November 2004"
-#define LSMDATE "22Nov04"
+#define BDATE   "24 November 2004"
+#define LSMDATE "24Nov04"
 
 /* Debug flags */
 #undef  DEBUG