Opened 9 years ago
Last modified 7 days ago
#104 new defect
The behavior of the backup_dump does not match documentation w.r.t. '-nohold'
| Reported by: | anonymous | Owned by: | Eric Swenson |
|---|---|---|---|
| Priority: | minor | Milestone: | |
| Component: | Hardcore | Version: | |
| Keywords: | backup unload | Cc: |
Description
The backup utilities are documented as unloading tapes by default, but do not.
complete_dump.info, backup_dump.info, catchup_dump.info:
-nohold rewinds and unloads the hierarchy dump tape or tapes at the end of the current dump pass. This is the default.
start_dump.info:
-nohold rewinds and unloads the hierarchy dump tape or tapes at the end of the current dump pass. This is the default for all hierarchy dump modes except incremental.
bk_ss_.cds: 2 holdsw bit (1), /* ON => do not unmount tape when done */ bk_ss_.cds: bk_static.holdsw = "0"b;
bk_arg_reader_:
else if op = "hold" then bk_ss_$holdsw = "1"b; /* do not dismount */ else if op = "nohold" then bk_ss_$holdsw = ""b; /* dismount, default */
then in start_dump.pl1, after 'examine_arguments:' (the "join" for complete_dump, catchup_dump, start_dump):
bk_ss_$holdsw = "1"b;
"-nohold" is also the documented behavior for 'retreive' and 'reload', but I have not tested the actual behavior.
retrieve.info, reload.info:
The following defaults are in effect for the reloader and retriever
before any backup commands are given; they are not, however, reset to
these values at the start of each backup command, except as noted
below.
-all -noquota
-error_of -primary
-map -reload
-nodebug -setlvid
-nohold -trim
Note:
See TracTickets
for help on using tickets.

This needs a decision before any further progress. Should we change the
documentation to match the code, or change the code to match the
documentation.
What the documentation says
backup_dump,complete_dump,catchup_dump:-nohold"rewinds and unloads the hierarchy dump tape or tapes at the end of the current dump pass. This is the default."start_dump: the same, but nohold "is the default for all hierarchy dump modes except incremental".reloadandretrieve:-noholdis among the defaults "in effect for the reloader and retriever before any backup commands are given".What the code does
Sources:
bound_dumper_.s.archive(start_dump.pl1,backup_dump.pl1,bk_output.pl1) andbound_reloader_.s.archive(bk_ss_.cds,bk_arg_reader_.pl1,bk_input.pl1).How the hold switch works
bk_ss_$holdsw. It starts"0"b(nohold) inbk_ss_.cds, andbk_arg_reader_sets it for-hold/-nohold.backup_dumpmounts and unmounts the tape. It callsbk_output$output_init(mount, if not mounted) at its start andbk_output$output_finishat its end.output_finishunmounts the tape unlessholdswis on.start_dump,catchup_dump,complete_dumpbk_ss_$holdsw = "1"batexamine_arguments, before reading their arguments. They callbackup_dump$abort_on_tape_errorsonce for each pathname in the dump control file, so forcing hold is what keeps the tape mounted from one pathname to the next, and from one incremental pass to the next.complete_dump: at the end of the dump (labelended) it setsholdswoff and callsoutput_finish. The tape is always unloaded, even if-holdwas given.catchup_dump: at the end of the catchup pass it does the same, then sets hold again and carries on asstart_dump.start_dump: the tape stays mounted between incremental passes untilend_dump, which unloads it.-noholdbehaves differently from the documentation. It leavesholdswoff, sooutput_finishunloads the tape after *each pathname* in the dump control file, not "at the end of the current dump pass".So for these three commands:
-noholdmatches the documentation in effect:complete_dumpandcatchup_dumpunload at the end of the pass, andstart_dumpholds between incremental passes.-noholditself does not do what is documented.-holdis ignored at the end ofcomplete_dumpandcatchup_dump.backup_dump(the command)-hold/-nohold. With nohold it unloads at the end of the command, as documented.holdswfrom an earlier command in the same process. Afterstart_dump(which leaves hold on untilend_dump), abackup_dumpwith no-noholdholds the tape. This may be what the ticket's reporter saw ("documented as unloading tapes by default, but do not").reloadandretrievebk_inputunmounts unlessholdswis on, the default is off, and the info segments already say the switches are not reset between commands.Options
complete_dump.infoandcatchup_dump.info: the tape is unloaded at the end of the dump pass whether or not-holdis given;-noholdunloads it after each pathname in the dump control file.start_dump.info: the tape is held between passes untilend_dump;-noholdunloads it after each pathname.backup_dump.info:-hold/-noholdremain in effect for later backup commands in the same process, asreload.infoandretrieve.infoalready say.-noholdmean "at the end of the pass" in the dump commands.start_dumpwould remember the user's-hold/-noholdseparately, keepholdswon during a pass, and at the end of each pass unload only if-noholdwas given (and, forcomplete_dump, keep the tape if-holdwas given).holdsw(and perhaps the other dump switches) at the start of eachbackup_dumpcommand, so that it does not inheritstart_dump's hold.Option 1 can be done with info-segment changes only. Options 2 and 3 change
bound_dumper_.