COBOL Manual for TNS and TNS/R Programs

Fault-Tolerant Processes
HP COBOL Manual for TNS and TNS/R Programs522555-006
32-8
Checkpointing
To prevent such duplicate write operations by the backup process, you must specify a
nonzero SYNCDEPTH parameter in the OPEN statement. This action allows the file
system to record the completion status of each input-output operation. If the backup
process requests an operation already completed by the primary process, the file
system recognizes this condition. Then, instead of performing the operation, the file
system returns the recorded completion status of the operation to the backup process.
If, however, the requested operation has not been performed, it is performed and the
completion status is returned to the backup process. The course of action taken by the
file system is completely invisible to the backup process.
The file system can save the completion status of the latest 15 disk-file operations and
relate those completions with up to 15 operations requested by a backup process upon
takeover from a failed primary process. (For $RECEIVE or other processes handled as
files, the number of saved completion status values is 255.) Use the SYNCDEPTH
parameter to specify the maximum number of completion status values that the file
system is to save. The SYNCDEPTH value is typically the same as the maximum
number of operations that write to a file without an intervening checkpoint of the file’s
sync block. The default SYNCDEPTH value is 1. In a Pathway application, the
SYNCDEPTH value must be 1.
General Rules
You can checkpoint the entire data area of the program and checkpoint each file after
the execution of each statement in your program, but this places a tremendous burden
on the interprocess message system and degrades the performance of your process
and all processes executing on the same processors as your process pair.
Minimize the number of checkpoints in a processing loop and the amount of data
checkpointed for each CHECKPOINT statement. One approach is to checkpoint only
the items necessary to establish a restart point. Verify that you have captured all
necessary data items (you might want to group them in the Data Division). Also, if you
checkpoint the contents of a record area, verify that the remainder of the data storage
is still valid in case of a takeover by the backup process.
Figure 32-3. Duplication in Takeover
x
(c)Restart point Checkpoint data and sync block
Write log-rec
*** FAILURE OF PRIMARY PROCESS***
VST718.vsd