]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
BEE Backport stored files
authorEric Bollengier <eric@baculasystems.com>
Wed, 6 Sep 2023 10:01:06 +0000 (12:01 +0200)
committerEric Bollengier <eric@baculasystems.com>
Thu, 14 Sep 2023 11:57:02 +0000 (13:57 +0200)
bacula/src/stored/ansi_label.c
bacula/src/stored/autochanger.c
bacula/src/stored/bsdjson.c
bacula/src/stored/bsr.h
bacula/src/stored/cloud_dev.c
bacula/src/stored/cloud_transfer_mgr.c
bacula/src/stored/dedup_dev.h
bacula/src/stored/dedup_interface.h
bacula/src/stored/stored_conf.h
bacula/src/stored/wait.c

index b05fa04831a0fc543a5a782a57de5c80d92b97f2..0fdf8a54e0c589c9898405dc1e26bccae331133d 100644 (file)
@@ -22,6 +22,7 @@
  *   tape labels.
  *
  *   Kern Sibbald, MMV
+ *
  */
 
 #include "bacula.h"                   /* pull in global headers */
index f40d06d4adc1d526f1da14c5b893177b4208761b..294509c3e25426dec42b30fd5269b5d05331deeb 100644 (file)
@@ -60,6 +60,7 @@ bool init_autochangers()
          if (!device->changer_command && changer->changer_command) {
             device->changer_command = bstrdup(changer->changer_command);
          }
+         /* ***BEEF*** */
          if (!device->lock_command && changer->lock_command) {
             device->lock_command = bstrdup(changer->lock_command);
          }
index 4f9f1538aef7a2521b474b9bd55dfa5bacfd03ae..11c13ce6ac382964b3761634b27943c215e5e4db 100644 (file)
@@ -431,6 +431,11 @@ static void dump_json(display_filter *filter)
          /* Copy the resource into res_all */
          memcpy(&res_all, res, sizeof(res_all));
 
+         if (strcmp(resources[resinx].name, "Dedupengine") == 0 &&
+             strcmp(res_all.hdr.name, "*Dedup*" /*default_legacy_dedupengine*/) == 0) {
+            continue; /* Don't display the dummy Dedupengine "*Dedup*" resource */
+         }
+
          if (filter->resource_name) {
             bool skip=true;
             /* The Name should be at the first place, so this is not a real loop */
@@ -739,10 +744,13 @@ static int check_resources()
 #ifdef SD_DEDUP_SUPPORT
    DEDUPRES *dedup;
    foreach_res(dedup, R_DEDUP) {
+      if (strcmp(dedup->hdr.name, "*Dedup*" /*default_legacy_dedupengine*/) == 0) {
+         break; /* this is the dummy "*Dedup* resource, test should be done in Storage */
+      }
       if (dedup->driver_type == D_LEGACY_DRIVER) {
          if (dedup->dedup_dir == NULL) {
             Jmsg(NULL, M_FATAL, 0,
-                 _("Failed to initialize Dedup Legasy. DedupDirectory not defined for Dedup \"%s\"\n"),
+                 _("Failed to initialize Dedup Legacy. DedupDirectory not defined for Dedup \"%s\"\n"),
                  dedup->hdr.name);
             OK = false;
          }
index f2aa5607359d41569d857b55a7d1f1aae9b81cc5..d5144736a7f71c1f1ea2142af482cfc85a53ce8d 100644 (file)
@@ -78,7 +78,6 @@ struct BSR_SESSID {
 struct BSR_SESSTIME {
    BSR_SESSTIME *next;
    uint32_t sesstime;
-   bool done;                         /* local done */
 };
 
 struct BSR_VOLFILE {
index 05a9cff59fc6a28ccd95608deb87fb7302148d3d..0a0bf6dcd3039ca575ea4b8df8dbc6ca1ab52e4e 100644 (file)
@@ -2174,7 +2174,7 @@ bool cloud_dev::is_eod_valid(DCR *dcr)
    }
    if (ok) {
       if (do_update) {
-         Dmsg2(dbglvl, "Correcting catalog for Volume \"%s\":\n%s", dcr->VolumeName, err.c_str());
+         Jmsg2(jcr, M_INFO, 0, _("Correcting catalog for Volume \"%s\":\n%s\n"), dcr->VolumeName, err.c_str());
          if (!dir_update_volume_info(dcr, false, true)) {
             Jmsg(jcr, M_WARNING, 0, _("Error updating Catalog\n"));
             dcr->mark_volume_in_error();
index 6830fd6c07ba55b9a2ca06989f561a6de73f7ce1..44e4d9a6ffbac4452d9c3e9eee1e28cb30cec30f 100644 (file)
@@ -268,8 +268,10 @@ uint32_t transfer::append_status(POOL_MEM& msg)
 void transfer::append_api_status(OutputWriter &ow)
 {
    lock_guard lg(m_stat_mutex);
+
    Dmsg2(dbglvl, "transfer::append_api_status state=%d JobId=%d\n", m_state, m_job_id);
 
+
    if (m_state > TRANS_STATE_PROCESSED) {
          ow.get_output(OT_START_OBJ,
                   OT_STRING,"volume_name",            NPRTB(m_volume_name),
index 0887062077317ced015215357c0ab14033280609..f4b64168c0b8c4e41a928bcb5c55fcac5c3c9349 100644 (file)
@@ -50,7 +50,7 @@ public:
    void term(DCR *dcr);
    virtual bool dedup_cmd(JCR *jcr);
    virtual void *dedup_get_dedupengine() { return (void*)dedupengine; };
-
+   virtual bool is_fs_nearly_full(uint64_t threshold);
 };
 
 #endif  /* DEDUP_DEV_H */
index b48d9f41dc891143a8653962d45f173610334941..df45c20bc0b1aef0856ebc30a40e83a8ce132309 100644 (file)
@@ -30,21 +30,20 @@ void dedup_filter_record(int verbose, DCR *dcr, DEV_RECORD *rec, char *dedup_msg
 /* Interface between DEDUP and SD */
 class DedupStoredInterfaceBase
 {
+#if 0
+protected:
+   virtual void *do_rehydration_thread(void){return NULL;};
+   virtual int handle_rehydration_command(BSOCK *fd){return -1;};
+#endif
+
 public:
 
    DedupStoredInterfaceBase(JCR *jcr, DedupEngine *dedupengine) {};
    virtual ~DedupStoredInterfaceBase() {};
 
-      // deduplication
-   virtual int start_deduplication() {return -1;};
-   virtual void *wait_deduplication(bool emergency=false) {return NULL;};
-   virtual void *do_deduplication_thread(void){return NULL;};
-
    // rehydration
    virtual int start_rehydration(){return -1;};
    virtual void *wait_rehydration(bool emergency=false){return NULL;};
-   virtual void *do_rehydration_thread(void){return NULL;};
-   virtual int handle_rehydration_command(BSOCK *fd){return -1;};
    virtual bool wait_flowcontrol_rehydration(int free_rec_count, int timeoutms){return false;};
    virtual bool do_flowcontrol_rehydration(int free_rec_count, int retry_timeoutms=250){return false;};
    virtual void warn_rehydration_eod() {};
index 67ffed3dc3ef12c7f97695001037fdc31969e501..ce5421d1ed7c092cba44b2c09df8a3baddc14cce 100644 (file)
@@ -133,6 +133,7 @@ public:
    DedupEngine *dedupengine;
    int dedupengine_use_count;
    char *dedup_err_msg;               /* is set for any error status */
+   uint32_t max_container_open;       /* the maximum number of simultaneously open container */
 };
 
 /*
index a0fcc4f584dd13da7063a78927d5bc5a30984a46..c6c3f7e5f2c8c9479007fcb90e922f7460ab68d7 100644 (file)
@@ -108,8 +108,8 @@ int wait_for_sysop(DCR *dcr)
          if (now - last_heartbeat >= me->heartbeat_interval) {
             /* Send Heartbeats
                Note when sd_client is set, the SD is acting as an FD,
-               but the SD has no code to receive heartbeats, so we
-               skip sending them.
+                bug the SD has code to receive heartbeats, so we skip
+                sending them.
             */
             if (jcr->file_bsock && !(jcr->is_JobType(JT_BACKUP) && jcr->sd_client)) {
                jcr->file_bsock->signal(BNET_HEARTBEAT);