]> git.sur5r.net Git - bacula/bacula/blob - bacula/kernstodo
Autochanger fixes
[bacula/bacula] / bacula / kernstodo
1                  Kern's ToDo List
2                   26 August 2002
3
4 Irix conversion notes:
5 - no uuencode
6 - no hostname
7 To do:    
8 - Document passwords.
9 - Document running multiple Jobs
10 - Document that two Verifys at same time on same client do not work.
11 - Document how to recycle a tape in 7 days even if the backup takes a long time.
12 - Document default config file locations.
13 - Document better includes (does it cross file systems ?).
14 - Document specifically how to add new File daemon to config files.
15 - Document forcing a new tape to be used.
16 - Document "Error in message.c:500 Mail program terminated in error.
17
18 From Chuck:
19 --bindir is wrong and does not reflect prefix= in the *_sqlite_* scripts
20   (src/cats)
21 --top level configure options are not passed to the depkgs, particularly
22   prefix=
23 --Also, it might be better to split the depkgs location from the --with-sqlite
24   location. 
25 --should be able to specify e.g. --with-sqlite=/opt/local and have it find
26   lib, bin, sbin for itself
27   I tried this and it didn't find sqlite.h
28 --sd.conf password does not match dir.conf storage password
29 =======
30
31 - Create all pools when Director starts
32 - Implement autochanger for restore. ARRRGGG! I forgot!
33 - Make BSR accept count (total files to be restored).
34 - Make BSR return next_block when it knows record is not
35   in block, done when count is reached, and possibly other
36   optimizations. I.e. add a state word.
37 - After unmount, if restore job started, ask to mount.
38 - Fix db_get_fileset in cats/sql_get.c for multiple records.
39 - Fix start/end blocks for File
40 - Add new code to scheduler.c and run_conf.c
41 - Volume Bytes shows bytes on last volume written in Job summary.
42 - Fix catalog filename truncation in sql_get and sql_create. Use
43   only a single filename split routine.
44 - Add command to reset VolFiles to a larger value (don't allow
45   a smaller number or print big warning).
46 - Make SD disallow writing on Volume with fewer files than in
47   the catalog.
48 - Make Restore report an error if FD or SD term codes are not OK.
49 - Convert all %x substitution variables, which are hard to remember
50   and read to %(variable-name).  Idea from TMDA.
51 - Report compression % and other compression statistics if turned on.
52 - Add JobLevel in FD status (but make sure it is defined).
53 - Make Pool resource handle Counter resources.
54 - Remove NextId for SQLite. Optimize.
55 - Fix gethostbyname() to use gethostbyname_r()
56 - Implement ./configure --with-client-only
57 - Strip trailing / from Include
58 - Move all SQL statements into a single location.
59 - Cleanup db_update_media and db_update_pool
60 - Add UA rc and history files.
61 - put termcap (used by console) in ./configure and
62   allow -with-termcap-dir.
63 - Remove JobMediaId it is not used.
64 - Enhance time and size scanning routines.
65 - Fix Autoprune for Volumes to respect need for full save.
66 - DateWritten field on tape may be wrong.
67 - Fix Win32 config file definition name on /install
68 - No READLINE_SRC if found in alternate directory.
69 - Add Client FS/OS id (Linux, Win95/98, ...).
70 - Put Windows files in Windows stream?
71 - Ensure that everyone uses btime routines.
72
73   
74 Projects:
75            Bacula Projects Roadmap 
76                17 August 2002
77
78 Item 1:   Multiple simultaneous Jobs. (done)
79
80   What:   Permit multiple simultaneous jobs in Bacula.
81
82   Why:    An enterprise level solution needs to go fast without the
83           need for the system administrator to carefully tweak
84           timing.  Based on the benchmarks, during a full
85           backup, NetWorker typically hit 10 times the bandwidth to
86           the tape compared to Bacula--largely. This is probably due to
87           running parallel jobs and multi-threaded filling of buffers
88           and writing them to tape.  This should also make things work
89           better when you have a mix of fast and slow machines backing
90           up at the same time.
91
92   Notes:  Bacula was designed to run multiple simultaneous jobs. Thus
93           implementing this is a matter of some small cleanups and
94           careful testing.
95
96
97 Item 2:   Make the Storage daemon use intermediate file storage to buffer data.
98           (not necessary)
99
100   What:   If data is coming into the SD too fast, buffer it to 
101           disk if the user has configured this option.
102
103   Why:    This would be nice, especially if it more or less falls out
104           when implementing (1) above.  If not, it probably should not
105           be given a high priority because fundamentally the backup time
106           is limited by the tape bandwidth.  Even though you may finish a
107           client job quicker by spilling to disk, you still have to
108           eventually get it onto tape.  If intermediate disk buffering
109           allows us to improve write bandwidth to tape, it may make
110           sense.
111
112   Notes:  Whether or not this is implemented will depend upon performance
113           testing after item 1 is implemented.
114
115
116 Item 3:   Write the bscan program.
117
118   What:   Write a program that reads a Bacula tape and puts all the 
119           appropriate data into the catalog. This allows recovery
120           from a tape that is no longer in the database, or it allows
121           re-creation of a database if lost.
122
123   Why:    This is a fundamental robustness and disaster recovery tool
124           which will increase the comfort level of a sysadmin
125           considering adopting Bacula.
126
127   Notes:  A skeleton of this program already exists, but much work
128           needs to be done. Implementing this will also make apparent
129           any deficiencies in the current Bacula tape format.
130
131
132 Item 4:   Implement Base jobs.
133
134   What:   A base job is sort of like a Full save except that you 
135           will want the FileSet to contain only files that are unlikely
136           to change in the future (i.e. a snapshot of most of your
137           system after installing it). After the base job has been run,
138           when you are doing a Full save, you can specify to exclude
139           all files saved by the base job that have not been modified.
140
141   Why:    This is something none of the competition does, as far as we know
142           (except BackupPC, which is a Perl program that saves to disk
143           only).  It is big win for the user, it makes Bacula stand out
144           as offering a unique optimization that immediately saves time
145           and money.
146
147   Notes:  Big savings in tape usage. Will require more resources because
148           the e. DIR must send FD a list of files/attribs, and the FD must
149           search the list and compare it for each file to be saved.
150
151
152 Item 5:   Implement Label templates
153
154   What:   This is a mechanism whereby Bacula can automatically create
155           a tape label for new tapes according to a detailed specification
156           provided by the user.
157
158   Why:    It is a major convenience item for folks who use automated label
159           creation.
160
161   Notes:  Bacula already has a working form of automatic tape label
162           creation, but it is very crude. The design for the complete
163           tape labeling project is already documented in the manual.
164
165
166 Item 6:   Write a regression script.
167
168   What:   This is an automatic script that runs and tests as many features
169           of Bacula as possible. The output is compared to previous
170           versions of Bacula and any differences are reported.
171
172   Why:    This is an enormous help in preventing introduction of new
173           errors in parts of the program that already work correctly.
174
175   Notes:  This probably should be ranked higher, it's something the typical
176           user doesn't see.  Depending on how it's implemented, it may
177           make sense to defer it until the archival tape format and
178           user interface mature.
179
180
181 Item 7:   GUI for interactive restore
182 Item 8:   GUI for interactive backup
183
184   What:   The current interactive restore is implemented with a tty
185           interface. It would be much nicer to be able to "see" the
186           list of files backed up in typical GUI tree format.
187           The same mechanism could also be used for creating 
188           ad-hoc backup FileSets (item 8).
189
190   Why:    Ease of use -- especially for the end user.
191
192   Notes:  Rather than implementing in Gtk, we probably should go directly
193           for a Browser implementation, even if doing so meant the
194           capability wouldn't be available until much later.  Not only
195           is there the question of Windows sites, most
196           Solaris/HP/IRIX, etc,  shops can't currently run Gtk programs
197           without installing lots of stuff admins are very wary about.
198           Real sysadmins will always use the command line anyway, and
199           the user who's doing an interactive restore or backup of his
200           own files will in most cases be on a Windows machine running
201           Exploder.
202
203
204 Item 9:   Add SSL to daemon communications.
205
206   What:   This provides for secure communications between the daemons.
207
208   Why:    This would allow doing backup across the Internet without
209           privacy concerns (or with much less concern).
210
211   Notes:  The vast majority of near term potential users will be backing up
212           a single site over a LAN and, correctly or not, they probably
213           won't be concerned with security, at least not enough to go to
214           the trouble to set up keys, etc. to screw things down.  We suspect
215           that many users genuinely interested in multi-site backup
216           already run some form of VPN software in their internetwork
217           connections, and are willing to delegate security to that layer.
218
219
220 Item 10:  Define definitive tape format.
221
222   What:   Define that definitive tape format that will not change 
223           for the next millennium.
224
225   Why:    Stability, security.
226
227   Notes:  See notes for item 11 below.
228
229
230 Item 11:  New daemon communication protocol.
231
232   What:   The current daemon to daemon protocol is basically an ASCII
233           printf() and sending the buffer. On the receiving end, the
234           buffer is sscanf()ed to unpack it. The new scheme would
235           be a binary format that allows quick packing and unpacking
236           of any data type with named fields.
237
238   Why:    Using binary packing would be faster. Named fields will permit
239           error checking to ensure that what is sent is what the 
240           receiver really wants.
241
242   Notes:  These are internal improvements in the interest of the
243           long-term stability and evolution of the program.  On the one
244           hand, the sooner they're done, the less code we have to rip
245           up when the time comes to install them.  On the other hand, they
246           don't bring an immediately perceptible benefit to potential
247           users.  Item 10 and possibly item 11 should be deferred until Bacula
248           is well established with a growing user community more or
249           less happy with the feature set.  At that time, it will make a
250           good "next generation" upgrade in the interest of data
251           immortality.
252
253
254
255 I haven't put these in any particular order.
256
257 Small projects:
258 - Rework Storage daemon with new rwl_lock routines.
259 - Compare tape to Client files (attributes, or attributes and data) 
260 - Restore options (overwrite, overwrite if older,
261    overwrite if newer, never overwrite, ...)
262 - Restore to a particular time -- e.g. before date, after date. 
263 - On command write out a bootstrap file (at end of job).
264 - Make all database Ids 64 bit.
265 - Pass JCR to database routines permitting better error printing.
266 - Make bls accept bootstrap record.
267 - Write an applet for Linux.
268 - Make SD reject writing on tape where Catalog and tape # files
269   don't agree (possibly OK if tape > catalog).
270 - Implement new daemon communications protocol.
271 - Add DIR config directive to spool attributes.
272 - Pass DIR config variable to SD for no attributes.
273 - Create JobMedia record for all running Jobs when Media changes.
274 - Send Volumes needed during restore to Console (just after
275   create_volume_list) -- also in restore command?
276 - Add estimate to Console commands
277 - Find solution to blank filename (i.e. path only) problem.
278
279 Dump:
280   mysqldump -f  --opt bacula >bacula
281
282
283 To be done:
284 - Remove PoolId from Job table, it exists in Media.
285 - Allow console commands to detach or run in background.
286 - Fix status delay on storage daemon during rewind.
287 - Add VerNo to each Session label record. 
288 - Add Job to Session records.
289 - Add VOLUME_CAT_INFO to the EOS tape record (as
290   well as to the EOD record).
291 - Add SD message variables to control operator wait time
292   - Maximum Operator Wait
293   - Minimum Message Interval
294   - Maximum Message Interval
295 - Add EOM handling variables
296   - Write EOD records
297   - Require EOD records
298 - Send Operator message when cannot read tape label.
299 - Think about how to handle I/O error on MTEOM.
300 - If Storage daemon aborts a job, ensure that this
301   is printed in the error message.
302 - Verify level=Volume (scan only), level=Data (compare of data to file).
303   Verify level=Catalog, level=InitCatalog
304 - Dump of Catalog
305 - Cold start full restore (restore catalog then
306   user selects what to restore).  Write summary file containing only
307   Job, Media, and Catalog information. Store on another machine.
308 - Dump/Restore database
309 - File system type
310 - Events file
311 - Add keyword search to show command in Console.
312 - Fix Win2000 error with no messages during startup.
313 - Events : tape has more than xxx bytes.
314 - In Storage daemon, status should include job cancelled.
315 - Write general list maintenance subroutines.
316 - Implement immortal format with EDOs. 
317 - Restrict characters permitted in a Resource name.
318 - Provide definitive identification of  type in backup.
319 - Complete  code in Bacula Resources -- this will permit
320   reading a new config file at any time.
321 - Document new Console
322 - Handle ctl-c in Console
323 - Test restore of Windows backup
324 - Implement LabelTemplate (at least first cut).
325 - Implement script driven addition of File daemon to
326   config files.
327
328 - Bug: anonymous Volumes requires mount in some cases.
329 - see setgroup and user for Bacula p4-5 of stunnel.c
330 - Implement new serialize subroutines
331    send(socket, "string", &Vol, "uint32", &i, NULL)
332 - Add save type to Session label.
333 - Correct date on Session label.
334 - On I/O error, write EOF, then try to write again.
335 - Audit all UA commands to ensure that we always prompt where
336   possible.
337 - If ./btape is called without /dev, assume argument is
338   a Storage resource name.
339 - Put memory utilization in Status output of each daemon
340   if full status requested or if some level of debug on.
341 - Make database type selectable by .conf files i.e. at runtime
342 - gethostbyname failure in bnet_connect() continues
343   generating errors -- should stop.
344 - Don't create a volume that is already written. I.e. create only once.
345 - If error at end of tape, implement some way to kill waiting processes.
346 - Add HOST to Volume label.
347 - Set flag for uname -a.  Add to Volume label.
348 - Implement throttled work queue.
349 - Write bscan program that will syncronize the DB Media record with
350   the contents of the Volume -- for use after a crash.
351 - Check for EOT at ENOSPC or EIO or ENXIO (unix Pc)
352 - Allow multiple Storage specifications (or multiple names on
353   a single Storage specification) in the Job record. Thus a job 
354   can be backed up to a number of storage devices.
355 - Implement full MediaLabel code.
356 - Implement dump label to UA
357 - Copy volume using single drive.
358 - Copy volume with multiple driven (same or different block size).     
359 - Add block size (min, max) to Vol label.
360 - Concept of VolumeSet during restore which is a list
361   of Volume names needed.
362 - Restore files modified after date
363 - Restore file modified before date
364 - Emergency restore info:
365   - Backup Bacula
366   - Backup working directory
367   - Backup Catalog
368 - Restore options (do not overwrite)
369 - Restore -- do nothing but show what would happen
370 - SET LD_RUN_PATH=$HOME/mysql/lib/mysql
371 - Put Job statistics in End Session Label (files saved,
372   total bytes, start time, ...).     
373 - Put FileSet name in the SOS label.
374 - Implement Restore FileSet=
375 - Write a scanner for the UA (keyword, scan-routine, result, prompt).
376 - Create a protocol.h and protocol.c where all protocol messages
377   are concentrated.
378 - If SD cannot open a drive, make it periodically retry.
379 - Put Bacula version somewhere in Job stream, probably Start Session
380   Labels.
381 - Remove duplicate fields from jcr (e.g. jcr.level and
382   jcr.jr.Level, ...).
383 - Timout a job or terminate if link goes down, or reopen link and query.
384 - Define how we handle times to avoid problem with Unix dates (2049 ?).
385 - Fill all fields in Vol/Job Header -- ensure that everything
386   needed is written to tape. Think about restore to Catalog
387   from tape.  Client record needs improving.
388 - Find general solution for sscanf size problems (as well
389   as sprintf. Do at run time?
390
391 - Concept of precious tapes (cannot be reused).
392 - Allow FD to run from inetd ???
393 - Preprocessing command per file.
394 - Postprocessing command per file (when restoring).
395
396 - Restore should get Device and Pool information from
397   job record rather than from config.
398 - Autolabel should be specified by DR instead of SD.
399 - Ability to recreate the catalog from a tape.
400 - Find out how to get the system tape block limits, e.g.:
401   Apr 22 21:22:10 polymatou kernel: st1: Block limits 1 - 245760 bytes.  
402   Apr 22 21:22:10 polymatou kernel: st0: Block limits 2 - 16777214 bytes.
403 - Storage daemon    
404   - Add media capacity
405   - AutoScan (check checksum of tape)
406   - Format command = "format /dev/nst0"
407   - MaxRewindTime
408   - MinRewindTime
409   - MaxBufferSize
410   - Seek resolution (usually corresponds to buffer size)
411   - EODErrorCode=ENOSPC or code
412   - Partial Read error code
413   - Partial write error code
414   - Nonformatted read error
415   - Nonformatted write error
416   - WriteProtected error
417   - IOTimeout
418   - OpenRetries
419   - OpenTimeout
420   - IgnoreCloseErrors=yes
421   - Tape=yes
422   - NoRewind=yes
423 - Pool
424   - Maxwrites
425   - Recycle period
426 - Job
427   - MaxWarnings
428   - MaxErrors (job?)
429 =====
430 - Eliminate duplicate File records to shrink database.
431 - FD sends unsaved file list to Director at end of job. 
432 - Write a Storage daemon that uses pipes and
433   standard Unix programs to write to the tape.
434   See afbackup.
435 - Need something that monitors the JCR queue and
436   times out jobs by asking the deamons where they are.
437 - Add daemon JCR JobId=0 to have a daemon context
438 - Pool resource
439   - Auto label
440   - Auto media verify
441   - Client (list of clients to force client)
442   - Devices (list of devices to force device)
443   - enable/disable
444   - Groups
445   - Levels
446   - Type: Backup, ...
447   - Recycle from other pools: Yes, No
448   - Recycle to other pools: Yes, no
449   - FileSets
450   - MaxBytes?
451   - Optional MediaType to force media?
452   - Maintain Catalog
453   - Label Template
454   - Retention Period
455   ============
456   - Name
457   - NumVols
458   - NaxVols
459   - CurrentVol
460
461 =====
462   if(connect(sockfd, (struct sockaddr * ) (& addr), sizeof(addr)) .lt. 0){
463     close(sockfd);
464     return(-6);
465   }
466
467   linger.l_onoff = 1;
468   linger.l_linger = 60;
469   i = setsockopt(sockfd, SOL_SOCKET, SO_LINGER, (char *) &linger,
470                                                 sizeof (linger));
471
472   fl = fcntl(sockfd, F_GETFL);
473   fcntl(sockfd, F_SETFL, fl & (~ O_NONBLOCK) & (~ O_NDELAY));
474 ====
475 - Enhance Jmsg code to permit buffering and saving to disk.
476 - device driver = "xxxx" for drives.
477 - restart: paranoid: read label fsf to
478   eom read append block, and go
479   super-paranoid: read label, read all files
480   in between, read append block, and go
481   verify: backspace, read append block, and go
482   permissive: same as above but frees drive
483   if tape is not valid.
484 - Verify from Volume
485 - Ensure that /dev/null works
486 - File daemon should build list of files skipped, and then
487   at end of save retry and report any errors.
488 - Need report class for messages. Perhaps
489   report resource where report=group of messages
490 - Verify from Tape
491 - enhance scan_attrib and rename scan_jobtype, and
492   fill in code for "since" option 
493 - To buffer messages, we need associated jobid and Director name.
494 - Need to save contents of FileSet to tape?
495 - Director needs a time after which the report status is sent
496   anyway -- or better yet, a retry time for the job.
497   Don't reschedule a job if previous incarnation is still running.
498 - Figure out how to save the catalog (possibly a special FileSet).
499 - Figure out how to restore the catalog.
500 - Figure out how to put a Volume into the catalog (from the tape)
501 - Figure out how to do a restore from a Volume
502 - Some way to automatically backup everything is needed????
503 - Need a structure for pending actions:
504   - buffered messages
505   - termination status (part of buffered msgs?)
506 - Concept of grouping Storage devices and job can use
507   any of a number of devices
508 - Drive management
509   Read, Write, Clean, Delete
510 - Login to Bacula; Bacula users with different permissions:
511    owner, group, user
512 - Tape recycle destination
513 - Job Schedule Status
514   - Automatic
515   - Manual
516   - Running
517 - File daemon should pass Director the operating system info
518   to be stored in the Client Record (or verified that it has
519   not changed).
520 - Store info on each file system type (probably in the job header on tape.
521   This could be the output of df; or perhaps some sort of /etc/mtab record.
522
523 Longer term to do:
524 - Use media 1 time (so that we can do 6 days of incremental
525   backups before switching to another tape) (already)
526   specify # times (jobs)
527   specify bytes (already)
528   specify time (seconds, hours, days)
529 - Implement FSM (File System Modules).
530 - Identify unchanged or "system" files and save them to a
531   special tape thus removing them from the standard 
532   backup FileSet -- BASE backup.
533 - Turn virutally all sprintfs into snprintfs.
534 - Heartbeat between daemons.
535 - Audit M_ error codes to ensure they are correct and consistent.
536 - Add variable break characters to lex analyzer.
537   Either a bit mask or a string of chars so that
538   the caller can change the break characters.
539 - Make a single T_BREAK to replace T_COMMA, etc.
540 - Ensure that File daemon and Storage daemon can
541   continue a save if the Director goes down (this
542   is NOT currently the case). Must detect socket error,
543   buffer messages for later. 
544
545
546 Done: (see kernsdone for more)
547 --the console script is broken as installed and has to be hand-massaged with
548   paths, config files etc.
549 - Termination status in FD for Verify = C -- incorrect.
550 - Implement alter_sqlite_tables
551 - Fix scheduler -- see "Hourly cycle". It doesn't do both each
552   hour, rather it alternates between 0:05 and 0:35.
553 - Create Counter DB records.
554 - Fix db_get_job_volume_names() to return array of strings (now works
555   with pool memory.
556 - Eliminate MySQL shared libraries from smtp and daemons not using MySQL.
557 - Compare tape File attributes to Catalog.
558   (File attributes are size, dates, MD5, but not
559    data).
560 - Report bad status from smtp or mail program.
561 - Ensure that Start/End File/Block are correct.
562 - If MySQL database is not running, job terminates with
563   wierd type and wierd error code.
564 - Probably create a jcr with JobId=0 as a master
565   catchall if jcr not found or if operation involves
566   global operation.
567 - The daemons should know when one is already
568   running and refuse to run a second copy.
569 - Figure out how to do a "full" restore from catalog
570 - Make SD send attribute stream to DR but first
571   buffering to file, then sending only when the
572   files are written to tape.
573 - Restore file xx or files xx, yy to their most recent values.
574 - Get correct block/file information in Catalog, pay attention to change of media.
575 - Write better dump of Messages resource.
576 - Authentication between SD and FD
577 - In restore job, print some summary information at end, such
578   as rate, ... job status, ...
579 - Problem with len at 362 in tree.c
580 - Report volume write rate.
581 - Pass "Catalog Files = no" to storage daemon to eliminate network traffic.
582 - When we are at EOM, we must ask each job to write JobMedia
583   record (update_volume_info).