OpenTP1 Version 7 Description

[Contents][Glossary][Index][Back][Next]

4.2.1 System files: status files

Organization of this subsection
(1) Purpose of status files
(2) Structure of status files
(3) Status of status files
(4) Swapping status files

(1) Purpose of status files

A status file stores information about OpenTP1 service activities and the OpenTP1 system configuration. This information is used for recovering OpenTP1 if a failure occurs. A status file stores data about system operations (such as what commands were entered and what effects the commands produced); so examining status files can help the OpenTP1 administrator or programmer to find out the cause of some abnormal termination. Status files also store the data necessary for automatically restarting OpenTP1.

The data that must be retained to restart OpenTP1 is called system control information. A status file stores system control information each time the status changes. Some items of system control information are:

(2) Structure of status files

The information in a status file is critical for restarting OpenTP1 so OpenTP1 duplicates this information within the status file. A status file is thus actually a logical filegroup, consisting of a pair of files: physical file A and physical file B. Even if an error occurs in one of the physical files, OpenTP1 can still be restarted by using the information in the other physical file.

To avoid both physical files being corrupted at the same time, place physical file A and physical file B on different disks if possible. Note that for the same status file, physical file A and physical file B must have the same size and record length.

(a) Operating with only one physical file in a status file

Usually, if a failure occurs in one physical file of a status file during online operation and no standby logical filegroup is found, OpenTP1 terminates abnormally. In the status service definition, however, you can specify whether to permit OpenTP1 to continue operation using the one normal physical file (either physical file A or B) only. In some manual versions, this operating with only one physical file in a status file is called one-system operation of a status file.

There is a serious drawback to operating with only one physical file in a status file: if another failure occurs, the restart information in the single physical file is lost, making a restart impossible. Thus when an OpenTP1 message in the message log reports that the system is operating with only one physical file in a status file, the OpenTP1 administrator should quickly prepare a usable standby logical filegroup and resume normal operation.

(3) Status of status files

The status of an OpenTP1 status file can be:

When OpenTP1 starts, it opens all the files defined in a status service definition as being part of a logical filegroup: i.e., part of a status file. Of the opened status files, the files assigned to store the status information are the current files and the others are standby files.

Status information is always stored in the same status file as long as no errors occur in it. In the current status file, OpenTP1 first writes system control information to physical file A and then to B. Therefore, even if an abnormal termination of OpenTP1 causes corruption of A files during a new write, OpenTP1 can be restarted in its former status by reading the uncorrupted B file in a complete recovery.

(4) Swapping status files

When status files are swapped, a standby file replaces the current status file. If an I/O error occurs in either physical file A or B, OpenTP1 copies the system control information from the undamaged file (either A or B) to the standby logical filegroup. In the standby logical filegroup, the system control information is first copied to physical file A and then to B. After the information is copied, the standby logical filegroup becomes the current logical filegroup.

If there is no standby logical file, OpenTP1 terminates abnormally. For the processing in this case, see 5.3 Failure and error recovery. However, if operation with only one physical file in a status file is specified, OpenTP1 continues operation using the single operable status file.

You can use commands to delete, resize, and re-create a status file that has been shut down because of a failure. The command used for deletion (stsrm), however, can delete only files that have an invalid or shutdown status; you cannot use it to delete the current or standby files.

The system control information in a status file is re-edited from the beginning of files A and B when status files are swapped. OpenTP1 automatically swaps status files as required to remove data fragmentation that might be caused by repeatedly starting and terminating OpenTP1.

Figure 4-5 illustrates how status files are swapped. For the processing if an error occurs in a status file, see 5.3 Failure and error recovery.

Figure 4-5 Swapping of status files

[Figure]