From: Kern Sibbald Date: Sun, 18 Aug 2002 11:31:09 +0000 (+0000) Subject: Performance enhancements X-Git-Tag: Release-1.25~42 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=124efe21d1a85147616300dab533482ff3c15351;p=bacula%2Fbacula Performance enhancements git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@101 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/kernstodo b/bacula/kernstodo index 9b1d671395..0ecff1b5bc 100644 --- a/bacula/kernstodo +++ b/bacula/kernstodo @@ -28,6 +28,7 @@ From Chuck: --sd.conf password does not match dir.conf storage password ======= +- Volume Bytes shows bytes on last volume written in Job summary. - Fix catalog filename truncation in sql_get and sql_create. Use only a single filename split routine. - Add command to reset VolFiles to a larger value (don't allow diff --git a/bacula/src/dird/ua_cmds.c b/bacula/src/dird/ua_cmds.c index 05079f4ac9..b10c44e136 100644 --- a/bacula/src/dird/ua_cmds.c +++ b/bacula/src/dird/ua_cmds.c @@ -978,7 +978,7 @@ static int setdebugcmd(UAContext *ua, char *cmd) static int deletecmd(UAContext *ua, char *cmd) { static char *keywords[] = { - N_("media"), + N_("volume"), N_("pool"), NULL}; @@ -988,8 +988,7 @@ static int deletecmd(UAContext *ua, char *cmd) bsendmsg(ua, _( "In general it is not a good idea to delete either a\n" -"Pool or Media since in both cases, you may delete Media\n" -"that contain data.\n\n")); +"Pool or a Volume since they may contain data.\n\n")); switch (find_arg_keyword(ua, keywords)) { case 0: diff --git a/bacula/src/dird/ua_restore.c b/bacula/src/dird/ua_restore.c index 786d4dffdc..cb4dc69b20 100644 --- a/bacula/src/dird/ua_restore.c +++ b/bacula/src/dird/ua_restore.c @@ -245,12 +245,12 @@ int restorecmd(UAContext *ua, char *cmd) if (ji.client) { Mmsg(&ua->cmd, - "run job=%s client=\"%s\" storage=\"%s\" bootstrap=\"%s/restore.bsr\"", + "run job=\"%s\" client=\"%s\" storage=\"%s\" bootstrap=\"%s/restore.bsr\"", job->hdr.name, ji.client->hdr.name, ji.store?ji.store->hdr.name:"", working_directory); } else { Mmsg(&ua->cmd, - "run job=%s storage=\"%s\" bootstrap=\"%s/restore.bsr\"", + "run job=\"%s\" storage=\"%s\" bootstrap=\"%s/restore.bsr\"", job->hdr.name, ji.store?ji.store->hdr.name:"", working_directory); } diff --git a/bacula/src/dird/ua_select.c b/bacula/src/dird/ua_select.c index ac3923a0fd..4aa0c21ae4 100644 --- a/bacula/src/dird/ua_select.c +++ b/bacula/src/dird/ua_select.c @@ -369,7 +369,7 @@ int select_pool_and_media_dbr(UAContext *ua, POOL_DBR *pr, MEDIA_DBR *mr) } if (mr->VolumeName[0] == 0) { db_list_media_records(ua->db, mr, prtit, ua); - if (!get_cmd(ua, _("Enter MediaId or Volume name to update: "))) { + if (!get_cmd(ua, _("Enter MediaId or Volume name: "))) { return 0; } if (is_a_number(ua->cmd)) { diff --git a/bacula/src/filed/backup.c b/bacula/src/filed/backup.c index b590d23816..5e063bdb70 100644 --- a/bacula/src/filed/backup.c +++ b/bacula/src/filed/backup.c @@ -187,6 +187,7 @@ static int save_file(FF_PKT *ff_pkt, void *ijcr) * Send Attributes header to Storage daemon * */ +#ifndef NO_FD_SEND_TEST if (!bnet_fsend(sd, "%ld %d 0", jcr->JobFiles, STREAM_UNIX_ATTRIBUTES)) { if (fid >= 0) { close(fid); @@ -225,6 +226,7 @@ static int save_file(FF_PKT *ff_pkt, void *ijcr) } /* send data termination sentinel */ bnet_sig(sd, BNET_EOD); +#endif /* * If the file has data, read it and send to the Storage daemon @@ -246,11 +248,13 @@ static int save_file(FF_PKT *ff_pkt, void *ijcr) } #endif +#ifndef NO_FD_SEND_TEST if (!bnet_fsend(sd, "%ld %d 0", jcr->JobFiles, stream)) { close(fid); return 0; } Dmsg1(10, ">stored: datahdr %s\n", sd->msg); +#endif if (ff_pkt->flags & FO_MD5) { MD5Init(&md5c); @@ -281,6 +285,7 @@ static int save_file(FF_PKT *ff_pkt, void *ijcr) sd->msg = jcr->compress_buf; /* write compressed buffer */ sd->msglen = compress_len; +#ifndef NO_FD_SEND_TEST if (!bnet_send(sd)) { sd->msg = msgsave; /* restore read buffer */ sd->msglen = 0; @@ -288,16 +293,19 @@ static int save_file(FF_PKT *ff_pkt, void *ijcr) return 0; } Dmsg1(30, "Send data to FD len=%d\n", sd->msglen); +#endif jcr->JobBytes += sd->msglen; sd->msg = msgsave; /* restore read buffer */ continue; } #endif +#ifndef NO_FD_SEND_TEST if (!bnet_send(sd)) { close(fid); return 0; } Dmsg1(30, "Send data to FD len=%d\n", sd->msglen); +#endif jcr->JobBytes += sd->msglen; } /* end while */ @@ -311,6 +319,8 @@ static int save_file(FF_PKT *ff_pkt, void *ijcr) * by the user to improve efficiency (i.e. poll every * other file, every third file, ... */ +#ifndef NO_FD_SEND_TEST +#ifndef NO_POLL_TEST bnet_sig(sd, BNET_EOD_POLL); Dmsg0(30, "Send EndData_Poll\n"); /* ***FIXME**** change to use bget_msg() */ @@ -324,6 +334,10 @@ static int save_file(FF_PKT *ff_pkt, void *ijcr) return 0; } } +#else + bnet_sig(sd, BNET_EOD); +#endif +#endif /* NO_FD_SEND_TEST */ close(fid); /* close file */ } @@ -331,12 +345,14 @@ static int save_file(FF_PKT *ff_pkt, void *ijcr) /* Terminate any MD5 signature and send it to Storage daemon and the Director */ if (gotMD5 && ff_pkt->flags & FO_MD5) { MD5Final(signature, &md5c); +#ifndef NO_FD_SEND_TEST bnet_fsend(sd, "%ld %d 0", jcr->JobFiles, STREAM_MD5_SIGNATURE); Dmsg1(10, "bfiled>stored:header %s\n", sd->msg); memcpy(sd->msg, signature, 16); sd->msglen = 16; bnet_send(sd); bnet_sig(sd, BNET_EOD); /* end of MD5 */ +#endif gotMD5 = 0; } #ifdef really_needed diff --git a/bacula/src/stored/append.c b/bacula/src/stored/append.c index b76f77b1db..20b6bfedaa 100644 --- a/bacula/src/stored/append.c +++ b/bacula/src/stored/append.c @@ -56,7 +56,12 @@ int do_append_data(JCR *jcr) sm_check(__FILE__, __LINE__, False); +#ifdef NO_ATTRIBUTES_TEST // jcr->spool_attributes = 1; + jcr->no_attributes = 1; +#endif + jcr->spool_attributes = 1; + if (!jcr->no_attributes && jcr->spool_attributes) { open_spool_file(jcr, jcr->dir_bsock); } diff --git a/bacula/src/stored/block.c b/bacula/src/stored/block.c index 7e1de01163..22ad24def5 100644 --- a/bacula/src/stored/block.c +++ b/bacula/src/stored/block.c @@ -259,6 +259,10 @@ int write_block_to_dev(DEVICE *dev, DEV_BLOCK *block) int stat = 0; uint32_t wlen; /* length to write */ +#ifdef NO_TAPE_WRITE_TEST + empty_block(block); + return 1; +#endif ASSERT(block->binbuf == ((uint32_t) (block->bufp - block->buf))); /* dump_block(block, "before write"); */ diff --git a/bacula/src/version.h b/bacula/src/version.h index f83e270d8e..415253ed28 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -1,11 +1,17 @@ /* */ -#define VERSION "1.24" +#define VERSION "1.25" #define VSTRING "1" -#define DATE "14 August 2002" -#define LSMDATE "14Aug02" +#define DATE "18 August 2002" +#define LSMDATE "18Aug02" /* Debug flags */ #define DEBUG 1 #define TRACEBACK 1 -#define SMCHECK 1 -/* #define DEBUG_MUTEX 1 */ +#define SMCHECK + +#define NO_POLL_TEST 1 + +/* #define NO_ATTRIBUTES_TEST 1 */ +/* #define NO_TAPE_WRITE_TEST 1 */ +/* #define NO_FD_SEND TEST 1 */ +/* #define DEBUG_MUTEX 1 */