Guardian Programmer's Guide

Table Of Contents
Fault-Tolerant Programming in C
Guardian Programmer’s Guide 421922-014
27 - 2
Summary of Active Backup Processing
An active backup program executes as a primary and backup process pair running the
same program file. The primary and backup processes communicate through
interprocess communication. The primary process sends critical data to the backup
process. This critical data serves two purposes: to provide sufficient information to
allow the backup to resume application processing and to indicate to the backup where
it should logically resume application processing.
The backup process receives messages from two sources. It receives critical
information from the primary process, which it must record for future use in the event it
must take over processing from the primary. It can also receive messages from the
operating system indicating that the primary process or CPU has failed. If the primary
process fails, the backup takes over processing at the logical point in the application
indicated by the most recent control state information received from the primary, and it
continues processing using the most recent file state and application state information.
Summary of Active Backup Processing
When an active backup program is started, it is given a process name. This allows the
new process (and later the backup process) to run as a named process pair (use of
unnamed process pairs is not discussed in this section). Following are the activities
that an active backup program performs:
A new process determines whether it is executing as the primary process or the
backup process.
If the process is the primary process, it does the following:
Opens files required for execution.
Creates and starts the backup process (normally in another CPU), and opens it
for interprocess communication.
Gets open file state information and sends it to the backup process.
Begins executing the application statements. At critical points, the primary
process updates state information; that is, it sends critical file and data
information to the backup process.
Monitors the backup process. If the backup process or CPU fails, the primary
can recognize that and create another backup.
If the process is the backup process, it enters a message-processing loop. While
in this loop, the backup process:
Does a backup open of any files required by the application. A backup open is
a special open that allows files to be open concurrently by both the primary and
backup processes.
Monitors the primary process and primary CPU.
The backup process stays in the message-processing loop until either the
primary process fails or the application terminates.