]> git.sur5r.net Git - bacula/bacula/blob - bacula/kernstodo
15751d9f335399823cc45dfe9d56b1945ff9c087
[bacula/bacula] / bacula / kernstodo
1                  Kern's ToDo List
2                  22 December 2002
3
4 Documentation to do: (a little bit at a time)
5 - Document running a test version.
6 - Make sure restore options are documented
7 - Document query file format.
8
9 Testing to do: (painful)
10 - that restore options work in FD (mostly done).
11 - that console command line options work
12 - blocksize recognition code.
13
14 For 1.28 release:
15 - Look at ua_prune.c in detail. Why did JobType work at all??????
16 - Implement FileOptions (see end of this document)
17 - Make hash table for linked files in findlib/find_one.c:161
18 - Make bcopy read through bad tape records.
19 - Need a verbose mode in restore, perhaps to bsr.
20 - Should we dump a SOS when starting a new tape?
21 - bscan without -v is too quiet -- perhaps show jobs.
22 - Add code to reject whole blocks if not wanted on restore.
23
24 - Figure out how to allow multiple simultaneous file Volumes on
25   a single device.
26 - Start working on Base jobs.
27 - Make sure the MaxVolFiles is fully implemented in SD
28 - Flush all the daemon messages at the end of every job.
29 - Check if both CatalogFiles and UseCatalog are set to SD.
30 - Check if we can increase Bacula FD priorty in Win2000
31 - Need return status on read_cb() from read_records(). Need multiple
32   records -- one per Job, maybe a JCR or some other structure with
33   a block and a record.
34
35 - Implement Bacula plugins -- design API
36
37 - Work more on how to to a Bacula restore beginning with
38   just a Bacula tape and a boot floppy (bare metal recovery).
39 - Try bare metal Windows restore
40 - Fix read_record to handle multiple sessions.
41 - Program files (i.e. execute a program to read/write files).
42   Pass read date of last backup, size of file last time.
43 - Put system type returned by FD into catalog.
44 - Possibly add email to Watchdog if drive is unmounted too
45   long and a job is waiting on the drive.
46 - Strip trailing slashes from Include directory names in the FD.
47 - Use read_record.c in SD code.
48 - Why don't we get an error message from Win32 FD when bootstrap 
49   file cannot be created for restore command?
50 - When Marking a file in Restore that is a hard link, also
51   mark the link so that the data will be reloaded.
52 - Restore program that errors in SD due to no tape reports
53   OK incorrectly in output.
54 - After unmount, if restore job started, ask to mount.
55 - Fix db_get_fileset in cats/sql_get.c for multiple records.
56 - Fix catalog filename truncation in sql_get and sql_create. Use
57   only a single filename split routine.
58 - Make Restore report an error if FD or SD term codes are not OK.
59 - Convert all %x substitution variables, which are hard to remember
60   and read to %(variable-name).  Idea from TMDA.
61 - Add JobLevel in FD status (but make sure it is defined).
62 - Make Pool resource handle Counter resources.
63 - Remove NextId for SQLite. Optimize.
64 - Fix gethostbyname() to use gethostbyname_r()
65 - Implement ./configure --with-client-only
66 - Strip trailing / from Include
67 - Move all SQL statements into a single location.
68 - Cleanup db_update_media and db_update_pool
69 - Add UA rc and history files.
70 - put termcap (used by console) in ./configure and
71   allow -with-termcap-dir.
72 - Enhance time and size scanning routines.
73 - Fix Autoprune for Volumes to respect need for full save.
74 - Fix Win32 config file definition name on /install
75 - No READLINE_SRC if found in alternate directory.
76 - Add Client FS/OS id (Linux, Win95/98, ...).
77 - Test a second language e.g. french.
78 - Compare tape to Client files (attributes, or attributes and data) 
79 - Restore options (overwrite, overwrite if older,
80    overwrite if newer, never overwrite, ...)
81 - Restore to a particular time -- e.g. before date, after date. 
82 - Make all database Ids 64 bit.
83 - Write an applet for Linux.
84 - Add estimate to Console commands
85 - Find solution to blank filename (i.e. path only) problem.
86 - Implement new daemon communications protocol.
87 - Remove PoolId from Job table, it exists in Media.
88 - Allow console commands to detach or run in background.
89 - Fix status delay on storage daemon during rewind.
90 - Add SD message variables to control operator wait time
91   - Maximum Operator Wait
92   - Minimum Message Interval
93   - Maximum Message Interval
94 - Send Operator message when cannot read tape label.
95 - Verify level=Volume (scan only), level=Data (compare of data to file).
96   Verify level=Catalog, level=InitCatalog
97 - Events file
98 - Add keyword search to show command in Console.
99 - Fix Win2000 error with no messages during startup.
100 - Events : tape has more than xxx bytes.
101 - Restrict characters permitted in a Resource name.
102 - Complete  code in Bacula Resources -- this will permit
103   reading a new config file at any time.
104 - Handle ctl-c in Console
105 - Implement LabelTemplate (at least first cut).
106 - Implement script driven addition of File daemon to config files.
107 - Think about how to make Bacula work better with File archives.
108
109 - see setgroup and user for Bacula p4-5 of stunnel.c
110 - Implement new serialize subroutines
111    send(socket, "string", &Vol, "uint32", &i, NULL)
112 - Audit all UA commands to ensure that we always prompt where possible.
113 - If ./btape is called without /dev, assume argument is a Storage resource name.
114 - Put memory utilization in Status output of each daemon
115   if full status requested or if some level of debug on.
116 - Make database type selectable by .conf files i.e. at runtime
117 - gethostbyname failure in bnet_connect() continues
118   generating errors -- should stop.
119 - Add HOST to Volume label.
120 - Set flag for uname -a.  Add to Volume label.
121 - Implement throttled work queue.
122 - Check for EOT at ENOSPC or EIO or ENXIO (unix Pc)
123 - Allow multiple Storage specifications (or multiple names on
124   a single Storage specification) in the Job record. Thus a job 
125   can be backed up to a number of storage devices.
126 - Implement dump label to UA
127 - Concept of VolumeSet during restore which is a list
128   of Volume names needed.
129 - Restore files modified after date
130 - Restore file modified before date
131 - Emergency restore info:
132   - Backup Bacula
133   - Backup working directory
134   - Backup Catalog
135 - Restore -- do nothing but show what would happen
136 - SET LD_RUN_PATH=$HOME/mysql/lib/mysql
137 - Implement Restore FileSet=
138 - Create a protocol.h and protocol.c where all protocol messages
139   are concentrated.
140 - If SD cannot open a drive, make it periodically retry.
141 - Remove duplicate fields from jcr (e.g. jcr.level and jcr.jr.Level, ...).
142 - Timout a job or terminate if link goes down, or reopen link and query.
143 - Fill all fields in Vol/Job Header -- ensure that everything
144   needed is written to tape. Think about restore to Catalog
145   from tape.  Client record needs improving.
146 - Find general solution for sscanf size problems (as well
147   as sprintf. Do at run time?
148 - Concept of precious tapes (cannot be reused).
149 - Make bcopy copy with a single tape drive.
150 - Permit changing ownership during restore.
151
152 - Restore should get Device and Pool information from
153   job record rather than from config.
154 - Autolabel should be specified by DR instead of SD.
155 - Find out how to get the system tape block limits, e.g.:
156   Apr 22 21:22:10 polymatou kernel: st1: Block limits 1 - 245760 bytes.  
157   Apr 22 21:22:10 polymatou kernel: st0: Block limits 2 - 16777214 bytes.
158 - Storage daemon    
159   - Add media capacity
160   - AutoScan (check checksum of tape)
161   - Format command = "format /dev/nst0"
162   - MaxRewindTime
163   - MinRewindTime
164   - MaxBufferSize
165   - Seek resolution (usually corresponds to buffer size)
166   - EODErrorCode=ENOSPC or code
167   - Partial Read error code
168   - Partial write error code
169   - Nonformatted read error
170   - Nonformatted write error
171   - WriteProtected error
172   - IOTimeout
173   - OpenRetries
174   - OpenTimeout
175   - IgnoreCloseErrors=yes
176   - Tape=yes
177   - NoRewind=yes
178 - Pool
179   - Maxwrites
180   - Recycle period
181 - Job
182   - MaxWarnings
183   - MaxErrors (job?)
184 =====
185 - FD sends unsaved file list to Director at end of job. 
186 - Write a Storage daemon that uses pipes and
187   standard Unix programs to write to the tape.
188   See afbackup.
189 - Need something that monitors the JCR queue and
190   times out jobs by asking the deamons where they are.
191
192 - Enhance Jmsg code to permit buffering and saving to disk.
193 - device driver = "xxxx" for drives.
194 - restart: paranoid: read label fsf to
195   eom read append block, and go
196   super-paranoid: read label, read all files
197   in between, read append block, and go
198   verify: backspace, read append block, and go
199   permissive: same as above but frees drive
200   if tape is not valid.
201 - Verify from Volume
202 - Ensure that /dev/null works
203 - File daemon should build list of files skipped, and then
204   at end of save retry and report any errors.
205 - Need report class for messages. Perhaps
206   report resource where report=group of messages
207 - enhance scan_attrib and rename scan_jobtype, and
208   fill in code for "since" option 
209 - Need to save contents of FileSet to tape?
210 - Director needs a time after which the report status is sent
211   anyway -- or better yet, a retry time for the job.
212   Don't reschedule a job if previous incarnation is still running.
213 - Figure out how to save the catalog (possibly a special FileSet).
214 - Figure out how to restore the catalog.
215 - Some way to automatically backup everything is needed????
216 - Need a structure for pending actions:
217   - buffered messages
218   - termination status (part of buffered msgs?)
219 - Concept of grouping Storage devices and job can use
220   any of a number of devices
221 - Drive management
222   Read, Write, Clean, Delete
223 - Login to Bacula; Bacula users with different permissions:
224    owner, group, user, quotas
225 - Store info on each file system type (probably in the job header on tape.
226   This could be the output of df; or perhaps some sort of /etc/mtab record.
227
228 Longer term to do:
229 - Design at hierarchial storage for Bacula.
230 - Implement FSM (File System Modules).
231 - Identify unchanged or "system" files and save them to a
232   special tape thus removing them from the standard 
233   backup FileSet -- BASE backup.
234 - Turn virutally all sprintfs into snprintfs.
235 - Heartbeat between daemons.
236 - Audit M_ error codes to ensure they are correct and consistent.
237 - Add variable break characters to lex analyzer.
238   Either a bit mask or a string of chars so that
239   the caller can change the break characters.
240 - Make a single T_BREAK to replace T_COMMA, etc.
241 - Ensure that File daemon and Storage daemon can
242   continue a save if the Director goes down (this
243   is NOT currently the case). Must detect socket error,
244   buffer messages for later. 
245 - Enhance time/duration input to allow multiple qualifiers e.g. 3d2h
246
247   
248 Projects:
249             Bacula Projects Roadmap 
250                17 August 2002
251            last update 27 November 2002
252
253 Item 1:   Multiple simultaneous Jobs. (done)
254 Done
255
256   What:   Permit multiple simultaneous jobs in Bacula.
257
258   Why:    An enterprise level solution needs to go fast without the
259           need for the system administrator to carefully tweak
260           timing.  Based on the benchmarks, during a full
261           backup, NetWorker typically hit 10 times the bandwidth to
262           the tape compared to Bacula--largely. This is probably due to
263           running parallel jobs and multi-threaded filling of buffers
264           and writing them to tape.  This should also make things work
265           better when you have a mix of fast and slow machines backing
266           up at the same time.
267
268   Notes:  Bacula was designed to run multiple simultaneous jobs. Thus
269           implementing this is a matter of some small cleanups and
270           careful testing.
271
272
273 Item 2:   Make the Storage daemon use intermediate file storage to buffer data.
274 Deferred -- not necessary yet.
275
276   What:   If data is coming into the SD too fast, buffer it to 
277           disk if the user has configured this option.
278
279   Why:    This would be nice, especially if it more or less falls out
280           when implementing (1) above.  If not, it probably should not
281           be given a high priority because fundamentally the backup time
282           is limited by the tape bandwidth.  Even though you may finish a
283           client job quicker by spilling to disk, you still have to
284           eventually get it onto tape.  If intermediate disk buffering
285           allows us to improve write bandwidth to tape, it may make
286           sense.
287
288   Notes:  Whether or not this is implemented will depend upon performance
289           testing after item 1 is implemented.
290
291
292 Item 3:   Write the bscan program -- also write a bcopy program.
293 Done
294
295   What:   Write a program that reads a Bacula tape and puts all the 
296           appropriate data into the catalog. This allows recovery
297           from a tape that is no longer in the database, or it allows
298           re-creation of a database if lost.
299
300   Why:    This is a fundamental robustness and disaster recovery tool
301           which will increase the comfort level of a sysadmin
302           considering adopting Bacula.
303
304   Notes:  A skeleton of this program already exists, but much work
305           needs to be done. Implementing this will also make apparent
306           any deficiencies in the current Bacula tape format.
307
308
309 Item 4:   Implement Base jobs.
310
311   What:   A base job is sort of like a Full save except that you 
312           will want the FileSet to contain only files that are unlikely
313           to change in the future (i.e. a snapshot of most of your
314           system after installing it). After the base job has been run,
315           when you are doing a Full save, you can specify to exclude
316           all files saved by the base job that have not been modified.
317
318   Why:    This is something none of the competition does, as far as we know
319           (except BackupPC, which is a Perl program that saves to disk
320           only).  It is big win for the user, it makes Bacula stand out
321           as offering a unique optimization that immediately saves time
322           and money.
323
324   Notes:  Big savings in tape usage. Will require more resources because
325           the e. DIR must send FD a list of files/attribs, and the FD must
326           search the list and compare it for each file to be saved.
327
328
329 Item 5:   Implement Label templates
330
331   What:   This is a mechanism whereby Bacula can automatically create
332           a tape label for new tapes according to a detailed specification
333           provided by the user.
334
335   Why:    It is a major convenience item for folks who use automated label
336           creation.
337
338   Notes:  Bacula already has a working form of automatic tape label
339           creation, but it is very crude. The design for the complete
340           tape labeling project is already documented in the manual.
341
342
343 Item 6:   Write a regression script.
344 Started
345
346   What:   This is an automatic script that runs and tests as many features
347           of Bacula as possible. The output is compared to previous
348           versions of Bacula and any differences are reported.
349
350   Why:    This is an enormous help in preventing introduction of new
351           errors in parts of the program that already work correctly.
352
353   Notes:  This probably should be ranked higher, it's something the typical
354           user doesn't see.  Depending on how it's implemented, it may
355           make sense to defer it until the archival tape format and
356           user interface mature.
357
358
359 Item 7:   GUI for interactive restore
360 Item 8:   GUI for interactive backup
361
362   What:   The current interactive restore is implemented with a tty
363           interface. It would be much nicer to be able to "see" the
364           list of files backed up in typical GUI tree format.
365           The same mechanism could also be used for creating 
366           ad-hoc backup FileSets (item 8).
367
368   Why:    Ease of use -- especially for the end user.
369
370   Notes:  Rather than implementing in Gtk, we probably should go directly
371           for a Browser implementation, even if doing so meant the
372           capability wouldn't be available until much later.  Not only
373           is there the question of Windows sites, most
374           Solaris/HP/IRIX, etc,  shops can't currently run Gtk programs
375           without installing lots of stuff admins are very wary about.
376           Real sysadmins will always use the command line anyway, and
377           the user who's doing an interactive restore or backup of his
378           own files will in most cases be on a Windows machine running
379           Exploder.
380
381
382 Item 9:   Add SSL to daemon communications.
383
384   What:   This provides for secure communications between the daemons.
385
386   Why:    This would allow doing backup across the Internet without
387           privacy concerns (or with much less concern).
388
389   Notes:  The vast majority of near term potential users will be backing up
390           a single site over a LAN and, correctly or not, they probably
391           won't be concerned with security, at least not enough to go to
392           the trouble to set up keys, etc. to screw things down.  We suspect
393           that many users genuinely interested in multi-site backup
394           already run some form of VPN software in their internetwork
395           connections, and are willing to delegate security to that layer.
396
397
398 Item 10:  Define definitive tape format.
399 Done (version 1.27)
400
401   What:   Define that definitive tape format that will not change 
402           for the next millennium.
403
404   Why:    Stability, security.
405
406   Notes:  See notes for item 11 below.
407
408
409 Item 11:  New daemon communication protocol.
410
411   What:   The current daemon to daemon protocol is basically an ASCII
412           printf() and sending the buffer. On the receiving end, the
413           buffer is sscanf()ed to unpack it. The new scheme would
414           be a binary format that allows quick packing and unpacking
415           of any data type with named fields.
416
417   Why:    Using binary packing would be faster. Named fields will permit
418           error checking to ensure that what is sent is what the 
419           receiver really wants.
420
421   Notes:  These are internal improvements in the interest of the
422           long-term stability and evolution of the program.  On the one
423           hand, the sooner they're done, the less code we have to rip
424           up when the time comes to install them.  On the other hand, they
425           don't bring an immediately perceptible benefit to potential
426           users.  Item 10 and possibly item 11 should be deferred until Bacula
427           is well established with a growing user community more or
428           less happy with the feature set.  At that time, it will make a
429           good "next generation" upgrade in the interest of data
430           immortality.
431
432
433
434
435 ====================================
436
437                 Request For Comments
438                    10 November 2002
439
440 Subject: File Backup Options
441
442 Problem: 
443   A few days ago, a Bacula user who is backing up to file volumes and
444   using compression asked if it was possible to suppress compressing
445   all .gz files since it was a waste of CPU time. Although Bacula
446   currently permits using different options (compression, ...) on
447   a directory by directory basis, it cannot do it on a file by 
448   file basis, which is clearly what was desired.   
449
450 Proposed Implementation:
451   To solve this problem, I propose the following:
452
453   - Add a new Director resource type called FileOptions.  
454
455   - The FileOptions resource will have records for all
456     options that can currently be specified on the Include record 
457     (in a FileSet).  Examples below.
458
459   - The FileOptions resource will permit an exclude option as well
460     as a number of additional options.
461
462   - The heart of the FileOptions resource is the ability to
463     supply any number of ApplyTo records which specify POSIX
464     regular expressions.  These ApplyTo regular expressions are
465     applied to the fully qualified filename (path and all). If
466     one matches, then the FileOptions will be used.
467
468   - When an ApplyTo specification matches an included file, the
469     options specified in the FileOptions resource will override
470     the default options specified on the Include record.
471
472   - Include records will be modified to permit referencing one or
473     more FileOptions resources.  The FileOptions will be used
474     in the order listed on the Include record and the first
475     one that matches will be applied.
476
477   - Options (or specifications) currently supplied on the Include
478     record will be deprecated (i.e. removed in a later version a
479     year or so from now).
480
481   - The Exclude record will be deprecated as the same functionality
482     can be obtained by using an Exclude = yes in the FileOptions.
483
484 FileOptions records:
485   The following records can appear in the FileOptions resource. An
486   asterisk preceding the name indicates a feature not currently
487   implemented.
488
489   For Backup Jobs:
490     - Compression= (GZIP, ...)
491     - Signature=   (MD5, SHA1, ...)
492     - *Encryption=
493     - OneFs=      (yes/no)    - remain on one filesystem
494     - Recurse=    (yes/no)    - recurse into subdirectories
495     - Sparse=     (yes/no)    - do sparse file backup
496     - *Exclude=   (yes/no)    - exclude file from being saved
497     - *Reader=    (filename)  - external read (backup) program
498
499   For Verify Jobs:
500     - verify=     (ipnougsamc5) - verify options
501
502   For Restore Jobs:
503     - replace= (always/ifnewer/ifolder/never) - replace options currently
504                                                 implemented in 1.27
505     - *Writer= (filename)   - external write (restore) program
506
507
508 Implementation:
509   Currently options specifying compression, MD5 signatures, recursion,
510   ... of a FileSet are supplied on the Include record. These will now
511   all be collected into a FileOptions resource, which will be
512   specified on the Include in place of the options. Multiple FileOptions
513   may be specified.  Since the FileOptions contain regular expressions
514   that are applied to the full filename, this will give the ability
515   to specify backup options on a file by file basis to whatever level
516   of detail you wish.
517
518 Example:
519
520   Today:
521
522     FileSet {
523       Name = "FullSet"
524       Include = compression=GZIP signature=MD5 {
525         /
526       }
527     }
528
529   Proposal:
530
531     FileSet {
532       Name = "FullSet"
533       Include = FileOptions=Opts {
534         /
535       }
536     }
537     FileOptions {
538       Name = Opts
539       Compression = GZIP
540       Signature = MD5
541       ApplyTo = /*.?*/
542     }
543
544   That's a lot more to do the same thing, but it gives the ability to
545   apply options on a file by file basis.  For example, suppose you
546   want to compress all files but not any file with extensions .gz or .Z.
547   You could do so as follows:
548
549     FileSet {
550       Name = "FullSet"
551       Include = FileOptions=NoCompress FileOptions=Opts {
552         /
553       }
554     }
555     FileOptions {
556       Name = Opts
557       Compression = GZIP
558       Signature = MD5
559       ApplyTo = /*.?*/   # matches all files
560     }
561     FileOptions {
562       Name = NoCompress
563       Signature = MD5
564       # Note multiple ApplyTos are ORed
565       ApplyTo = /*.gz/   # matches .gz files */
566       ApplyTo = /*.Z/    # matches .Z files */
567     }
568
569   Now, since the NoCompress FileOptions is specified first on the
570   Include line, any *.gz or *.Z file will have an MD5 signature computed,
571   but will not be compressed. For all other files, the NoCompress will not
572   match, so the Opts options will be used which will include GZIP
573   compression.
574
575 Questions:
576   - Is it necessary to provide some means of ANDing regular expressions
577     and negation?  (not currently planned)
578
579     e.g.  ApplyTo = /*.gz/ && !/big.gz/
580
581   - I see that Networker has a "null" module which, if specified, does not 
582     backup the file, but does make an record of the file in the catalog
583     so that the catalog will reflect an exact picture of the filesystem.
584     The result is that the file can be "seen" when "browsing" the save
585     sets, but it cannot be restored.
586     
587     Is this really useful?  Should it be implemented in Bacula?
588   
589 Results:
590   After implementing the above, the user will be able to specify
591   on a file by file basis (using regular expressions) what options are
592   applied for the backup.
593 ====================================
594
595 Done: (see kernsdone for more)
596 - Add EOM records? No, not at this time. The current system works and
597   above all is simple.
598 - Add VolumeUseDuration and MaximumVolumeJobs to Pool db record and
599   to Media db record.
600 - Add VOLUME_CAT_INFO to the EOS tape record (as
601   well as to the EOD record). -- No, not at this time.
602 - Put MaximumVolumeSize in Director (MaximumVolumeJobs, MaximumVolumeFiles,
603    MaximumFileSize).
604 - Enhance schedule to have 1stSat, ...
605 - Make sure catalog doesn't keep growing.
606 - On I/O error, write EOF, then try to write again ? No, keep it simple.
607 - Figure out how compress everything except .gz,... files.
608   Implement FileOptions.
609 - Put Bacula version somewhere in Job stream, probably Start Session Labels.
610 - Fix start/end blocks for File devices
611 - Make Job err if WriteBootstrap fails.
612 - Test that mod of restore options works.
613 - Test that week position schedule code works.
614 - Make BSR accept count (total files to be restored).
615 - Add code to fast seek to proper place on tape/file when doing Restore.
616 - Replace popen() and pclose() -- fail safe and timeout, no SIG dep.
617 - Add code to put VolFile in bsr for restore command.
618 - Volumes can be listed multiple times in Restore volume list.
619 - Add watchdog timeout for child processes start_child_timer()
620   end_child_timer();
621 - Get rid of bscan.c:534 error message (one time only).
622 - Print some statistics when get EOF on device in bscan -- feedback
623   to let user know it is working.
624 - DateWritten field on tape may be wrong.
625 - Ensure that restore of differential jobs works (check SQL).
626 - Count number of ignored messages in bscan and print when first SOS is found.
627 - Test that EndFile/Block are correctly updated at end of tape 
628   (in view of new block reading code).
629 - Test watchdog child timer code.
630 - Test new BSR code (mostly done).
631