Availability Guide for Application Design

Availability Through Process-Pairs and Monitors
Availability Guide for Application Design525637-004
7-11
Takeover by the Passive Backup
to the corresponding open from the primary process. It is this relationship that enables
file synchronization to work.
The checkpointed file synchronization information helps to determine how subsequent
I/O operations are handled. Some of these operations might already have been
executed by the primary process.
The file-synchronization information consists of a synchronization identifier whose
value gets incremented for each I/O operation. The synchronization identifier gets
incremented until its value reaches the sync depth for the file as specified when the file
was opened. The sync depth indicates the maximum number of I/O operations
between checkpoints.
Synchronization identifiers are maintained in two places: in the server process, where
an identifier is incremented on receipt of an I/O request from the application; and in the
application, where an identifier is incremented on notification that the I/O request
finished.
The file system and server process establish the status of the I/O operation as follows,
for a specific file:
If the value of the synchronization identifier known to the new primary process is
the same as the value known to the server process, then the operation is assumed
to have not taken place and the server process goes ahead and executes it.
If the synchronization identifiers are different, then it is assumed that the operation
has already been executed so the operation is not repeated.
The synchronization protocol between the application (requester) process and the disk
(server) process normally works as follows:
1. The synchronization identifier and data to be written are checkpointed to the
application backup process before the write operation. This operation ensures that
if the write must be repeated in the backup process, it will do so with the same
synchronization identifier and the same data.
2. The file system sends the I/O request to the disk process.
3. On receipt of the request, the disk process checks that the synchronization
identifier of the application matches its own value for the same file, and then
increments its synchronization identifier for that file. At this point, the
synchronization identifier of the application and the disk process are different.
4. The disk process reads the data block from disk, updates it, then checkpoints the
synchronization identifier and the updated data block to the backup disk process to
guard against failure of the primary disk process.
5. The disk process writes the updated data block to disk.
6. On successful completion, the disk process records the completion status and
replies to the application.