Guardian Programmer's Guide

Table Of Contents
Fault-Tolerant Programming in C
Guardian Programmer’s Guide 421922-014
27 - 13
Types of State Information
actual techniques and procedures you use to format, send, and receive the messages
containing the state information are described earlier in this section under Organizing
an Active Backup Program.
As a programmer, you must determine where to do the updates within your program
and what information you want to include in each update. Enough continuation points
must be provided, and each must contain enough information, so that if the primary
process fails, the backup process can take over execution while maintaining the
integrity of any data currently in use. Keep in mind that errors can result if you fail to
include all the data that has been modified.
The number and frequency of continuation points you should provide depend on the
degree of recoverability you require. As an extreme example, a primary process, after
execution of each program statement, could send its entire data area to the backup
process. A program of this type would be recoverable after each statement. But
because of the amount of system resources needed, the program would be extremely
time-consuming and inefficient.
Processes typically update only elements that have changed since the last update.
This minimizes the update message length and message-handling overhead.
In developing a strategy for updating state information, you need to decide:
What information to update
Where within your program to place the update points
How frequently to do the updates
Types of State Information
There are three types of state information:
Control state defines the logical points in the backup process at which execution
is to resume if the primary process fails.
File state consists of disk file sync blocks. Sync blocks contain control information
about the current state of a disk file, including the file's sync ID. You can use the
sync ID to ensure that no write operation is duplicated when the backup process
takes over for the primary process.
Application state gives the backup process the data values it needs to take over
execution. Application state information may include file buffers and current values
of process variables.
An update message from the primary process to the backup process must completely
define a continuation point; that is, it must provide control state, application state, and,
if I/O is done in the program, file state information.