Data processing system with transaction processing application

Abstract: A data processing system includes at least one transaction processing application and a plurality of data managers which can be accessed by the transaction processing application. Each data manager is responsible for managing a separate data base. The system further includes a work-in-progress store and a work-in-progress store manager for managing the work-in-progress store. Whenever the transaction processing application instructs a data manager to perform an update, the data manager passes information concerning the update to the work-in-progress store manager which records this information in the work-in-progress store, and whenever the application completes a transaction, the data managers perform updates to their respective databases and the work-in-progress store manager is instructed to discard the contents of the work-in-progress store relating to this transaction.

Description: Background to the invention This invention relates to data processing systems and is particularly concerned with data processing systems involving transaction processing and database management. Support for transaction processing requires the ability to ensure that the effects of data updates associated with a transaction are atomic; that is either all updates are applied or none. This atomicity must be achieved irrespective of failure during the transaction. This capability is often achieved by writing the updates associated with the transaction to a separate log file before they are applied to the database. Only if all of the updates to be applied are secured in the log file is the transaction completed by the data manager applying the updates to the database. Once all of the updates have been applied the transaction must be marked as complete in the log file. Where a transaction involves more than one such data manager the data managers defer to a separate coordinator to control the progress of the transaction. As before each data manager writes its updates to a log file instead of updating the database. When the user work for the transaction ends the coordinator requests that each data manager puts itself in a state where it is prepared to commit or rollback the transaction (by writing to its own log). When all of the involved data managers have reached this state the coordinator secures the decision to commit the transaction in its own log and tells each data manager to commit any changes. Before replying that it has committed, each data manager records in its own log that it has completed. When all the data managers have completed, the coordinator records the completion of the transaction in its own log. Each transaction therefore involves 2n+2 log writes, where n is the number of data managers involved in the transaction. ACM Transactions on Computer Systems, vol.2, no.1, 1st February 1984, New York, US, pages 24-38; Bruce G. Lindsay et al.: "Computation and Communication in R*: A Distributed Database Manager" describes a distributed database system having a transaction manager that implements a 2-phase commit protocol. The protocol first propagates a "prepare to commit" message to all sites of the transaction. At each site, the updates to the transaction are made recoverable by writing information to a non-volatile database log. When all sites have acknowledged the "prepare to commit" request, the transaction manager sends a "commit" message to all the sites. EP 0 098 928 describes a logging method using volatile and non-volatile storage. The object of the present invention is to provide an improved data processing system in which the number of writes to log files is reduced. Summary of the invention According to the present invention, there is provided a data processing system as defined in Claim 1. It can be seen that, when a transaction is completed, the data managers do not have to access individual log files to perform any logging action; only a single logging write is required to remove the record of the transaction from the work-in-progress store. Brief description of the drawings Figure 1 is a schematic block diagram of a data processing system in accordance with the invention. Figure 2 is a sequence diagram illustrating the operation of the system. Description of an embodiment of the invention One data processing system in accordance with the invention will now be described by way of example with reference to the accompanying drawings. Referring to Figure 1, the system includes a number of application programs 10 which run in a transaction processing environment. (In this example, only one application program is shown, but in general there may be many such programs in the system). The application program 10 can access two databases 12 (DATABASE 1 and DATABASE 2). Each of these databases has its own data manager 14 (DM1 and DM2). The applications and the data managers all communicate with a coordination controller (COCO) 16. The data managers also communication with a work-in-progress store manager (WSM) 18, which controls a work-in-progress (WIP) store 20. In this embodiment the data managers, coordination controller and work-in-progress store manager are all software components which run on the same host processor as the application programs. For example, the host processor may be an ICL Series 39 system running under the VME operating system. Communication between these components is achieved by a messaging service. Details of this messaging service form no part of the present invention and so will not be described herein. The WIP store comprises two portions: a volatile store 22, which consists of an area of the main RAM of the system, and a non-volatile store 24, which consists of an area of disc store. Referring now to Figure 2, this shows a typical sequence of operations of the above components. In this example, it is assumed that the application program performs a transaction, in which it updates both the databases in turn. The data updates associated with a transaction are atomic, in that, at the end of the transaction either all the updates associated with the transaction must be applied to the respective databases, or none, depending on whether or not the transaction is deemed to have been successfully completed. As shown in Figure 2, whenever the application generates a database update, it sends a message to the appropriate data manager (DM1 or DM2). The data manager then sets locks on the data in the database, so as to prevent any other transaction from updating the data while the present transaction is in progress, and passes details of the update to the work-in-progress store manager WSM. The WSM then writes details of the changes to be made to the data into the volatile area of the WIP store. When the user work for the transaction is complete, the application sends a message to the COCO. The COCO then sends a PREPARE message to each of the data managers (DM1, DM2) involved in the transaction. In response to this PREPARE message, each data manager confirms that all the changes in the data have been passed to the WSM, and returns a READY message to the COCO. When the COCO has received READY messages from each of the data managers, it sends a RECORD message to the WSM, instructing it to record all the changes to the data (currently held in volatile store) into the non-volatile portion of the WIP store. When the WSM has done this, the COCO sends a COMMIT message to each of the data managers involved in the transaction. In response to this COMMIT message, each data manager applies the updates to its database. No logging action is required. When it has done this, each data manager returns a COMMITTED message to the COCO. When the COCO has received a COMMITTED message from each of the data managers, it sends a DISCARD message to the WSM, instructing it to discard the changes logged in the non-volatile portion of the WIP store in respect of this transaction. (These are no longer required since the databases have now been updated). When the WSM has done this, the COCO sends a COMPLETE message to each of the data managers involved in the transaction. When the data managers receive the COMPLETE message, they release any locks applied to their respective databases, and return a COMPLETED message to the COCO, informing it that the transaction is now complete. Conveniently, the WIP store is implemented as a serial file. For each transaction, two records are written to the file: one containing all the data manager updates and the COCO's commit decision marker; the other indicating that the transaction is complete. A garbage collection process is periodically applied to this file to release any records which relate to transactions that have been both committed and completed. If the system fails while transactions are outstanding, the WSM removes any records from the WIP store file that have been only partially written. The COCO then completes all commitment units for which the commit record has been completed but the completion marker has not. In a modification of the system described above, if all accesses to data are by way of the WIP store, the writing of the data to the non-volatile part of the WIP store may be delayed, so that only one I/O operation is required per transaction, rather than two.

Claims: A data processing system comprising: at least one transaction processing application (10); a plurality of data managers (14), which can be accessed by the transaction processing application, each data manager being responsible for managing a separate database; and a commitment co-ordinator (16), for co-ordinating the commitment of the databases to ensure that updates to the databases are performed atomically; characterised in that : (a) the system further includes a work-in-progress store (20), common to and shared between all said data managers, and a work-in-progress store manager (18) for managing the work-in-progress store (20) ; (b) whenever one of the data managers (14) performs an update forming part of a transaction, the data manager passes information concerning the update to the work-in-progress store manager (18) to be recorded in the work-in-progress store (20); (c) whenever the transaction processing application completes a transaction, it informs the commitment co-ordinator (16), which then requests all the data managers to confirm that they have passed their update information relating to this transaction to the work-in-progress store manager (18); (d) when all the data managers have so confirmed, the commitment co-ordinator (16) requests all the data managers to commit the transaction by updating their respective databases; and when all the data managers have confirmed that they have updated their respective databases, the commitment co-ordinator instructs the work-in-progress store manager (18) to discard the information recorded in the work-in-progress store (20) relating to updates forming part of this transaction. A system according to claim 1 wherein (a) the work-in-progress store comprises a volatile portion (22) and a non-volatile portion (24); (b) the update information is initially recorded in the volatile portion; and (c) when all the data managers have confirmed that they have passed their update information relating to a transaction to the work-in-progress store, and before requesting the data managers to commit the transaction, the commitment co-ordinator (16) instructs the work-in-progress store to transfer all the information relating to the transaction to the non-volatile portion. A system according to either preceding claim wherein the volatile portion (22) comprises a RAM and the non-volatile portion (24) comprises a disk file. A system according to any preceding claim wherein the work-in-progress store is organised as a serial file.

Inventors: HERBERT RICHARD, HERBERT, RICHARD
Applicants: INT COMPUTERS LTD, INTERNATIONAL COMPUTERS LIMITED
Application year: 1992
Main classification: G06F17
IPC codes: G06F11, G06F17