Availability Guide for Application Design
Availability Through Process-Pairs and Monitors
Availability Guide for Application Design—525637-004
7-15
Takeover by the Active Backup
Opening Files in the Backup Process
Every file that is open in the primary process and must be synchronized must also be
open in the backup process. The backup process must use the
__ns_backup_fopen() function to do this.
To open each file with the same open status as in the primary process, the backup
process must supply the file-open status to the __ns_backup_fopen() function. The
backup process receives this information from the primary process by reading
$RECEIVE.
Saving Critical Data
There are no general rules about how the backup process should handle critical data it
reads from $RECEIVE. The action is application dependent but typically involves
simply updating the backup process's copy of the data value in question.
Saving File-State Information
If a message read from $RECEIVE contains file-state information, then the backup
process must use this information to update its own state information for the same file.
The __ns_fset_file_state() function provides a simple mechanism for updating
the file status information in the backup process. File-synchronization information is
copied to the backup process using this technique.
Processing Control-State Information
Again, the way control-state information is handled in the backup process is application
dependent. One approach might be to simply update a data value. On takeover, the
data value could be used to determine process flow by a case statement.
Receiving Messages From the Operating System
The active backup process uses the same mechanisms for reading system messages
as used in the passive backup model. As in the passive backup model, the active
backup knows when the primary stops or is otherwise unreachable when the backup
receives one of the following messages:
•
Process Deletion
•
Processor Down
Refer to the discussion on the Passive Backup Model on page 7-6 for details.
Takeover by the Active Backup
The backup must take over as the new primary if one of the following occurs:
•
The primary process stops.
•
The processor or system in which the primary process is running fails.