From: Eric Bollengier Date: Wed, 6 Sep 2023 10:01:06 +0000 (+0200) Subject: BEE Backport stored files X-Git-Tag: Beta-15.0.0~109 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bdc7c2d9e88967ba88ea0a87da7b2171ce28b9e1;p=thirdparty%2Fbacula.git BEE Backport stored files --- diff --git a/bacula/src/stored/ansi_label.c b/bacula/src/stored/ansi_label.c index b05fa0483..0fdf8a54e 100644 --- a/bacula/src/stored/ansi_label.c +++ b/bacula/src/stored/ansi_label.c @@ -22,6 +22,7 @@ * tape labels. * * Kern Sibbald, MMV + * */ #include "bacula.h" /* pull in global headers */ diff --git a/bacula/src/stored/autochanger.c b/bacula/src/stored/autochanger.c index f40d06d4a..294509c3e 100644 --- a/bacula/src/stored/autochanger.c +++ b/bacula/src/stored/autochanger.c @@ -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); } diff --git a/bacula/src/stored/bsdjson.c b/bacula/src/stored/bsdjson.c index 4f9f1538a..11c13ce6a 100644 --- a/bacula/src/stored/bsdjson.c +++ b/bacula/src/stored/bsdjson.c @@ -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; } diff --git a/bacula/src/stored/bsr.h b/bacula/src/stored/bsr.h index f2aa56073..d5144736a 100644 --- a/bacula/src/stored/bsr.h +++ b/bacula/src/stored/bsr.h @@ -78,7 +78,6 @@ struct BSR_SESSID { struct BSR_SESSTIME { BSR_SESSTIME *next; uint32_t sesstime; - bool done; /* local done */ }; struct BSR_VOLFILE { diff --git a/bacula/src/stored/cloud_dev.c b/bacula/src/stored/cloud_dev.c index 05a9cff59..0a0bf6dcd 100644 --- a/bacula/src/stored/cloud_dev.c +++ b/bacula/src/stored/cloud_dev.c @@ -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(); diff --git a/bacula/src/stored/cloud_transfer_mgr.c b/bacula/src/stored/cloud_transfer_mgr.c index 6830fd6c0..44e4d9a6f 100644 --- a/bacula/src/stored/cloud_transfer_mgr.c +++ b/bacula/src/stored/cloud_transfer_mgr.c @@ -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), diff --git a/bacula/src/stored/dedup_dev.h b/bacula/src/stored/dedup_dev.h index 088706207..f4b64168c 100644 --- a/bacula/src/stored/dedup_dev.h +++ b/bacula/src/stored/dedup_dev.h @@ -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 */ diff --git a/bacula/src/stored/dedup_interface.h b/bacula/src/stored/dedup_interface.h index b48d9f41d..df45c20bc 100644 --- a/bacula/src/stored/dedup_interface.h +++ b/bacula/src/stored/dedup_interface.h @@ -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() {}; diff --git a/bacula/src/stored/stored_conf.h b/bacula/src/stored/stored_conf.h index 67ffed3dc..ce5421d1e 100644 --- a/bacula/src/stored/stored_conf.h +++ b/bacula/src/stored/stored_conf.h @@ -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 */ }; /* diff --git a/bacula/src/stored/wait.c b/bacula/src/stored/wait.c index a0fcc4f58..c6c3f7e5f 100644 --- a/bacula/src/stored/wait.c +++ b/bacula/src/stored/wait.c @@ -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);