From fb446838109c17f3af164e04b386b4e8dc22dc6e Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sat, 25 Nov 2006 13:38:03 +0000 Subject: [PATCH] kes Add Landon's refactor of restore Feature request to the projects file. kes Tweak debug levels and messages for examining the disk seek problem. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3697 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/kernstodo | 4 ++++ bacula/projects | 39 +++++++++++++++++++++++++++++++++++++ bacula/src/filed/restore.c | 9 ++++----- bacula/src/stored/fd_cmds.c | 2 +- bacula/technotes-1.39 | 5 +++++ 5 files changed, 53 insertions(+), 6 deletions(-) diff --git a/bacula/kernstodo b/bacula/kernstodo index 235b1017dd..0da65c17df 100644 --- a/bacula/kernstodo +++ b/bacula/kernstodo @@ -41,6 +41,10 @@ Document: Priority: +- Look at moving the Storage directive from the Job to the + Pool in the default conf files. +- Make sure the new level=Full syntax is used in all + example conf files (especially in the manual). - Fix prog copyright (SD) all other files. - Migration Volume span bug - Rescue release diff --git a/bacula/projects b/bacula/projects index 5bc64dfb4f..070f416723 100644 --- a/bacula/projects +++ b/bacula/projects @@ -1154,3 +1154,42 @@ Item n: Allow inclusion/exclusion of files in a fileset by creation/mod times So one could compare against 'ctime' and/or 'mtime', but ONLY 'before' or 'since'. + +Item: Implement support for stacking arbitrary stream filters, sinks. +Date: 23 November 2006 +Origin: Landon Fuller +Status: Planning. Assigned to landonf. + +What: + Implement support for the following: + - Stacking arbitrary stream filters (eg, encryption, compression, + sparse data handling)) + - Attaching file sinks to terminate stream filters (ie, write out + the resultant data to a file) + - Refactor the restoration state machine accordingly + +Why: + The existing stream implementation suffers from the following: + - All state (compression, encryption, stream restoration), is + global across the entire restore process, for all streams. There are + multiple entry and exit points in the restoration state machine, and + thus multiple places where state must be allocated, deallocated, + initialized, or reinitialized. This results in exceptional complexity + for the author of a stream filter. + - The developer must enumerate all possible combinations of filters + and stream types (ie, win32 data with encryption, without encryption, + with encryption AND compression, etc). + +Notes: + This feature request only covers implementing the stream filters/ + sinks, and refactoring the file daemon's restoration implementation + accordingly. If I have extra time, I will also rewrite the backup + implementation. My intent in implementing the restoration first is to + solve pressing bugs in the restoration handling, and to ensure that + the new restore implementation handles existing backups correctly. + + I do not plan on changing the network or tape data structures to + support defining arbitrary stream filters, but supporting that + functionality is the ultimate goal. + + Assistance with either code or testing would be fantastic. diff --git a/bacula/src/filed/restore.c b/bacula/src/filed/restore.c index aeb017c635..fbf90fc987 100644 --- a/bacula/src/filed/restore.c +++ b/bacula/src/filed/restore.c @@ -224,7 +224,8 @@ void do_restore(JCR *jcr) Jmsg1(jcr, M_FATAL, 0, _("Record header scan error: %s\n"), sd->msg); goto bail_out; } - Dmsg2(30, "Got hdr: FilInx=%d Stream=%d.\n", file_index, stream); + Dmsg4(30, "Got hdr: Files=%d FilInx=%d Stream=%d, %s.\n", + jcr->JobFiles, file_index, stream, stream_to_ascii(stream)); /* * Now we expect the Stream Data */ if (bget_msg(sd) < 0) { @@ -235,7 +236,8 @@ void do_restore(JCR *jcr) Jmsg2(jcr, M_FATAL, 0, _("Actual data size %d not same as header %d\n"), sd->msglen, size); goto bail_out; } - Dmsg1(30, "Got stream data, len=%d\n", sd->msglen); + Dmsg3(30, "Got stream: %s len=%d extract=%d\n", stream_to_ascii(stream), + sd->msglen, extract); /* If we change streams, close and reset alternate data streams */ if (prev_stream != stream) { @@ -250,7 +252,6 @@ void do_restore(JCR *jcr) switch (stream) { case STREAM_UNIX_ATTRIBUTES: case STREAM_UNIX_ATTRIBUTES_EX: - Dmsg1(30, "Stream=Unix Attributes. extract=%d\n", extract); /* * If extracting, it was from previous stream, so * close the output file and validate the signature. @@ -361,8 +362,6 @@ void do_restore(JCR *jcr) case STREAM_ENCRYPTED_SESSION_DATA: crypto_error_t cryptoerr; - Dmsg1(30, "Stream=Encrypted Session Data, size: %d\n", sd->msglen); - /* Do we have any keys at all? */ if (!jcr->pki_recipients) { Jmsg(jcr, M_ERROR, 0, _("No private decryption keys have been defined to decrypt encrypted backup data.")); diff --git a/bacula/src/stored/fd_cmds.c b/bacula/src/stored/fd_cmds.c index fea8909d12..bb1cea3831 100644 --- a/bacula/src/stored/fd_cmds.c +++ b/bacula/src/stored/fd_cmds.c @@ -359,7 +359,7 @@ bool get_bootstrap_file(JCR *jcr, BSOCK *sock) Jmsg(jcr, M_FATAL, 0, _("Error parsing bootstrap file.\n")); goto bail_out; } - if (debug_level > 20) { + if (debug_level >= 10) { dump_bsr(jcr->bsr, true); } ok = true; diff --git a/bacula/technotes-1.39 b/bacula/technotes-1.39 index 0e6b0395d1..b9cf96c86c 100644 --- a/bacula/technotes-1.39 +++ b/bacula/technotes-1.39 @@ -1,6 +1,11 @@ Technical notes on version 1.39 General: +25Nov06 +kes Add Landon's refactor of restore Feature request to the + projects file. +kes Tweak debug levels and messages for examining the disk + seek problem. 22Nov06 kes Cleanup some of the error termination code in migration. kes Separate read/write source strings to keep track of where -- 2.39.5