DISTRIBUTED TRANSACTIONAL PROCESSING SYSTEM AND METHOD

Abstract: A system and method for replicating data in a distributed transactional processing system having redundant cache memories and disk memories. The data replicating method includes updating a primary cache, followed by updating the secondary cache. Next, the primary disk memory is updated, followed by the secondary disk memory being updated. Based upon the success of each update, a determination is made as to whether the data replication is successful. In a number of instances, the data replication operation is determined to have been successfully executed despite the failure of one or more memory updates. The resulting database is highly available to the rest of the system.

Description: DISTRIBUTED TRANSACTIONAL PROCESSING SYSTEM AND METHOD BACKGROUND OF THE INVENTION Technical Field of the Invention The present invention relates to a distributed transactional processing system, and in particular to a system and method of replicating data in a distributed database. Background and Objects of the Invention Today, many computing systems, such as distributed transactional processing systems, utilize cache memory in order to increase processing speeds. A cache may typically comprise random access memory (RAM) and a register which points to a location in the RAM where previously stored data resides. Cache memory may be a fraction of the size of main memory. By keeping the most frequently accessed data in the cache, memory access time approaches the access time of the cache. High performance transactional processing systems typically possess relatively high data transaction rates and data availability characteristics. These required system characteristics have led to the architecture of system databases to both employ cache memory to achieve the high data transaction rates as well as use redundant memory devices to better ensure that data is substantially and consistently accessible to the rest of the system. For example, prior systems have employed a pair of cache memories designated as a primary cache and a secondary cache. Prior systems additionally employed a pair of disk memories designated as a primary disk memory and a secondary disk memory. One problem associated with systems employing redundant memory devices concerns data replication, i.e., maintaining consistency throughout the memory database during system operation. Prior transactional processing systems included various synchronous protocols to replicate data between the memory devices. One such synchronous protocol, a two phase commit procedure, often causes the database and system to hang in the event access to a memory device fails. As a result, there exists a need for an improved data replication procedure for use in a transactional processing system. It is an object of the present invention to provide a method for replicating data in a distributed transactional processing system. It is another object of the present invention to provide such a method which better maintains database availability despite memory device failure. SUMMARY OF THE INVENTION The present invention overcomes the shortcomings in existing transactional processing systems and satisfies a significant need for a system and method for replicating data while maintaining high availability and performance levels. According to a preferred embodiment of the present invention, there is provided a system and method for a distributed transactional processing system. The system includes a distributed database which provides an interface to a number of clients. The distributed database includes two memory nodes. Each memory node includes a cache memory and a memory disk. One cache memory is designated the primary cache and the other the secondary cache. Similarly, one memory disk is designated the primary disk and the other is designated the secondary disk. Each cache and disk preferably has a cache manager process and disk manager process associated therewith, respectively. The caches, cache managers, disks and disk managers are configured to perform, among other tasks, data replication within the database. When a client associated with the database presents a transaction thereto, such as a request to update the database with a data obj ect, the system attempts to first update the primary cache with the data object, followed by attempting to update the secondary cache. Next, an attempt is made to update the primary disk with the data object. The system then attempts to update the secondary disk with the data object. A process associated with the client monitors the success of each attempt to update the memory devices, and generates a response thereto. In the event that the primary cache was the only memory device successfully updated, the requested transaction has failed. The client is notified of the failure. In addition, since the primary cache was successfully updated with the data object, the updated data object is deleted therefrom. The next time the data object is accessed from the database, the data obj ect is taken from the primary disk and copied into the primary cache. In the event the data object is not successfully deleted from the primary cache, then the primary cache is marked as being out of sync and the secondary cache is designated as the primary cache. Later, attempts may be undertaken to automatically re-sync the primary cache. In the event that only the primary cache and just one of the disks were successfully updated with the data object, then the transaction is deemed to be successfully completed . The client is notified of a successful commit. The secondary cache and the disk which failed to be updated are both marked as being out of sync. In the event that only the secondary cache is unsuccessfully updated, then the transaction is deemed to have been successfully completed. The client is notified of the successful commit. The secondary cache is marked as being out of sync. In the event the both the primary and the secondary disks are unsuccessfully updated, then the transaction is deemed to have been unsuccessfully completed. The client is notified of the unsuccessful commit. The data object is deleted from the primary and secondary caches. If the data obj ect is unsuccessfully deleted from either of the caches, then the corresponding cache is marked as being out of sync. In the event that only one of the disks was unsuccessfully updated with the data object, then the transaction is deemed to have been successfully performed. The client is notified ofthe successful commit. The disk which was unsuccessfully updated is marked as being out of sync. If the data object was successfully loaded into each ofthe caches and disks, then the client is notified ofthe successfully completed transaction. BRIEF DESCRIPTION OF THE DRAWINGS A more complete understanding ofthe present invention may be had by reference to the following detailed description when taken in conjunction with the accompanying drawings wherein: Figure 1 is a block diagram ofthe processing system according to the present invention; and Figure 2 is a flow chart illustrating the operation ofthe present invention. DETAILED DESCRIPTION OF THE PREFERRED EXEMPLARY EMBODIMENTS The present invention will now be described more fully hereinafter with reference to the accompanying drawings in which preferred embodiments ofthe invention are shown . This invention may, however, be embodied in many different forms and should not be construed as being limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope ofthe invention to those skilled in the art. Referring to Figure 1 , there is shown a distributed transactional processing database system 1 according to the present invention. The system preferably includes distributed database 2 which provides data to a number of clients 3. Distributed database 2 preferably includes disk memory 4 and 5 which serve as the primary memory disk and the secondary memory disk for the distributed processing system 1 , respectively. It is understood that the distributed processing system 1 possesses the capability to designate either disk memory 4 or disk memory 5 as the primary memory disk and the secondary memory disk during system operation. Disk memory 4 will be designated the primary memory disk and secondary memory disk memory 5 will be designated the secondary memory disk for exemplary purposes only. Primary disk memory 4 and secondary disk memory 5 are preferably operatively associated with disk manager processes 6 and 7, respectively. Disk manager 6 preferably serves as a primary disk manager for controlling access to primary disk memory 4. Similarly, disk manager 7 preferably serves as a secondary disk manager 7 for secondary disk memory 5 for controlling access thereto. Distributed database 2 preferably further includes primary cache memory 8 and secondary cache memory 9, each of which is operatively connected to primary disk memory 4 and secondary disk memory 5 in order to serve as memory having a relatively fast access time for storing the most immediately accessed data. Distributed database 2 preferably further includes client processes 10 and 11 which are operatively associated with primary cache memory 8 and secondary cache memory 9, respectively. Client process 10 preferably acts as the cache manager for primary cache memory 8 by controlling access thereto. Similarly, client process 11 preferably acts as cache manager for secondary cache memory 9 by controlling access thereto. In this way, data is transferred between caches 8 and 9 and disk memories 4 and 5 via cache managers 10 and 11 and disk managers 6 and 7, as indicated in Figure 1. By including dual caches 8 and 9 and dual disk memories 4 and 5, the present distributed transactional processing system 1 substantially ensures data availability to clients 3. Primary cache memory 8 and secondary cache memory 9 are preferably capable of maintaining multiple versions of a data obj ect stored therein. Specifically, caches 8 and 9 preferably include or are otherwise operatively connected to index registers 12 and 13 , respectively. Index registers 12 and 13 are preferably capable of pointing to different versions ofthe same data object stored in caches 8 and 9, respectively, and thus facilitate concurrent access thereto by more than one client 3. Index registers 12 and 13 are modified to point to a new version of a data object when the data object is written into caches 8 and 9, respectively, and when the data object is removed therefrom. When a data object is removed from caches 8 and 9, index registers 12 and 13 are modified to remove their reference to the version ofthe data obj ect that is to be removed. The reference count for a data object helps to ensure that the data object continues to reside in the cache memory 8 or 9. A data object is considered wired in a cache memory 8 or 9 if the reference count therefor is one or more. Distributed database 2 further includes processes 14-15 and 14'- 15' which are controlled by clients 3 and which serve as client read and write processes for performing memory accesses within database 2. The transfer of data between the memory devices within database 2 and clients 3 is controlled by control and interface process 16. As stated above, the present invention enables processing system 1 and/or database 2 to successfully commit a transaction, such as a request for writing or updating a data object in database 2, despite a failure occurring in one or more memory devices (caches 8 and 9 and disk memories 4 and 5). Specifically, the present system executes a data replication procedure which allows database 2 to continue to function despite the occurrence of memory device failure(s). Referring to Figure 2, the operation ofthe transactional processing system 1 is as follows. When database 2 receives an external transaction from a client 3 , such as a request to commit to a memory update, interface and control process 16 manages the memory update. Because all four ofthe memory devices must be updated with the new data object (or version thereof) in order to maintain consistency therebetween, interface and control process 16 initiates a data replication procedure within database 2. Initially, a portion of database 2 is rendered inaccessible throughout the data replication process. The database portion rendered inaccessible may be the page in the memory devices containing the new data object (after being written therein) or even just the new data object itself. Next, an attempt is made to update primary cache memory 8 at step 20, followed by an attempt to update secondary cache memory 9 at step 21. Next, database 2 attempts to update primary disk memory 4 (step 22) and then attempts to update secondary disk memory 5 (step 23). The status of each ofthe four attempts to update the memory devices is maintained by interface and control process 16. It is noted that the specific sequence of memory updates is important in order to ensure consistency during the data replication procedure. For instance, initially updating caches 8 and 9 ensures that the new data obj ect is accessible to system 1 during the time disk memories 4 and 5 are being updated. Following the completion ofthe four attempts to update caches 8 and 9 and disk memories 4 and 5, interface and control process 16 preferably examines the status of each attempt, and determines whether to commit to the external transaction (the memory update request) based upon this examination. In the event primary cache memory 8 was successfully updated while secondary cache memory 9, primary disk memory 4 and secondary disk memory 5 were not successfully updated, then interface and control process 16 determines that the external transaction (the memory update request) has failed at step 24. Interface and control process 16 then submits a response signal to the requesting client 3 that the commit to the request failed. In addition, an attempt is made to delete the data object from primary cache memory 8 at step 25 in order to maintain consistency between the memory devices. This delete operation is carried out by modifying index register 12 associated with primary cache memory 8 so that index register 12 no longer points to the new data object. If the delete operation was unsuccessful, interface and control process 16 generates an alarm signal and marks primary cache memory 8 as being out of sync at step 26. At this point, the cache memory identified as secondary cache memory 9 is designated as the primary cache memory for the system. Concerning primary cache memory 8 being identified as out of sync, the present system 1 may preferably allow for an automatic re-sync operation of primary cache memory 8 at a later time. For example, database 2 may maintain a log 17 which may contain a listing ofthe data objects which were not successfully updated in primary cache memory 8, secondary cache memory 9, primary disk memory 4 and secondary disk memory 5. Occasionally, such as on a periodic basis, an attempt is preferably undertaken to replicate the data obj ects which were previously unsuccessfully updated in the memory devices. In the event a memory device, such as primary cache memory 8, is successfully updated with those data objects which were previously unsuccessfully updated therein, the memory device is re-synced and fully operational. In the event that only primary cache memory 8 and just one of disks 4 and 5 were successfully updated with the data object, then interface and control process 16 determines that the external transaction was successfully completed at step 27. Interface and control process 16 then submits a response to the requesting client 3 that the commit was successful. Secondary cache memory 9 and the disk memory 4 or 5 which also failed to be updated are marked as being out of sync at step 28. In the event that only secondary cache memory 9 was unsuccessfully updated (step 29), then interface and control process 16 determines that the transaction was successfully completed (step 30). The requesting client 3 is sent a signal acknowledging the successful commit. Further, an alarm is generated as to secondary cache memory 9 failing to be updated, and secondary cache memory 9 is marked as being out of sync (step 31). In the event the both primary disk memory 4 and secondary disk memory 5 were unsuccessfully updated while both caches 8 and 9 were successfully updated, then interface and control process 16 determines that the external transaction has failed (step 32). The requesting client 3 is notified ofthe unsuccessful commit (step 33). Next, an attempt is made to delete the new data object from both primary cache memory 8 and secondary cache memory 9 (step 33). If the new data object is unsuccessfully deleted from either or both of caches 8 or 9, then the cache(s) corresponding to a failed delete operation is marked as being out of sync (step 34). In the event that only one of disks 4 or 5 was unsuccessfully updated with the data obj ect while the remaining memory devices were successfully updated, interface and control process 16 determines that the external transaction was successfully executed (step 35). The client is notified ofthe occurrence ofthe successful commit. The disk memory 4 or 5 which was unsuccessfully updated is marked as being out of sync (step 36). In the event that each memory device (primary cache memory 8, secondary cache memory 9, primary disk memory 4 and secondary disk memory 5) was successfully updated, then interface and control process 16 determines that the update was successful and submits a signal to that effect to the requesting client 3 (step 35). It is noted that all other success scenarios not described above result in the external transaction being unsuccessfully executed. The above-described procedure for data replication in a transactional processing system having high availability is based in part upon cache index registers 12 and 13 being updated to point to the new data obj ect (or version thereof) substantially concurrently with the updating of caches 8 and 9, respectively. It is understood that index registers 12 and 13 may alternatively be updated after successfully writing each memory device and only after a determination is made that the requested external transaction has successfully completed. In this way, clients are prevented from accessing the new data object version that may later be deleted due to the commit to the external transaction failing. In this alternative method, the index registers 12 and 13 will not have to be corrected if the external transaction fails. In fact, the only step necessary following the determination ofthe external transaction commit failure is releasing the space occupied by the new data object in caches 8 and 9. Although the preferred embodiments ofthe system and method ofthe present invention have been illustrated in the accompanying drawings and described in the foregoing detailed description, it will be understood that the invention is not limited to the embodiments disclosed, but is capable of numerous rearrangements, modifications and substitutions without departing from the spirit ofthe invention as set forth and defined by the following claims.

Claims: WHAT IS CLAIMED IS: 1. A method for replicating data in a database of a processing system, the database including a primary cache memory, a secondary cache memory, a primary disk memory and a secondary disk memory, the method comprising the steps of: receiving a request from a client to write a data object in the database; attempting to write the data obj ect in the primary cache memory in response to the step of receiving the request; attempting to write the data object in the secondary cache memory following the step of attempting to write in the primary cache memory; attempting to write the data object in the primary disk memory following the step of attempting to write in the secondary cache memory; attempting to write the data object in the secondary disk memory following the step of attempting to write in the primary disk memory; checking for a successful writing ofthe data object in each ofthe primary cache memory, the secondary cache memory, the primary disk memory and the secondary disk memory; and acknowledging to the client ofthe successful writing ofthe data object upon an affirmative determination ofthe data obj ect being successfully written in the primary cache memory and in at least one ofthe primary disk memory and the secondary disk memory. 2. The method of claim 1, further including the step of: marking the secondary cache, the primary disk memory or the secondary disk memory as being out of sync based upon the step of checking. 3. The method of claim 2, wherein: the step of marking comprises the step of marking the secondary cache as being out of sync upon a determination that the data object was not successfully written therein. 4. The method of claim 2, wherein: the step of marking comprises the step of marking the primary disk memory as being out of sync upon a determination that the data object was not successfully written therein. 5. The method of claim 2, wherein: the step of marking comprises the step of marking the secondary disk memory as being out of sync upon a determination that the data object was not successfully written therein. 6. The method of claim 1, further including the step of: alerting the client of a failed attempt to write the data object upon an affirmative determination ofthe data obj ect being unsuccessfully written to the primary disk memory and the secondary disk memory. 7. The method of claim 6, further including the step of: attempting to delete the data object from the primary cache memory following the determination ofthe data object being unsuccessfully written to the primary disk memory and the secondary disk memory. 8. The method of claim 7, further including the step of: determining whether the data object was successfully deleted from the primary cache memory following the step of attempting to delete the data object; and marking the primary cache memory as being out of sync upon a determination that the data object was unsuccessfully deleted from the primary cache memory. 9. The method of claim 8, further including the step of: designating the secondary cache memory as the primary cache memory. 10. The method of claim 6, further including the step of: attempting to delete the data object from the secondary cache memory upon a determination that the data object was successfully written into the secondary cache memory and unsuccessfully written to the primary disk memory and the secondary disk memory. 11. The method of claim 10, further including the step of: determining whether the data obj ect was successfully deleted from the secondary cache memory following the step of attempting to delete the data object therefrom; and marking the secondary cache memory as being out of sync upon a determination that the data object was unsuccessfully deleted from the secondary cache memory. 12. The method of claim 1, wherein: the step of acknowledging is performed based upon the determination that the data object was successfully written to only one ofthe primary disk memory and the secondary disk memory. 13. A database for a transactional processing system, comprising: a primary cache memory; a secondary cache memory; a primary memory disk; a secondary memory disk; a means for receiving a request from a client to write a data obj ect in the database; a means for attempting to write the data object in the primary cache memory in response to receiving the request; a means for attempting to write the data object in the secondary cache memory following the attempting to write in the primary cache memory; a means for attempting to write the data object in the primary disk memory following the attempting to write in the secondary cache memory; a means for attempting to write the data object in the secondary disk memory following the attempting to write in the primary disk memory; a means for checking for a successful writing ofthe data object in each ofthe primary cache memory, the secondary cache memory, the primary disk memory and the secondary disk memory; and a means for acknowledging to the client ofthe successful writing ofthe data obj ect upon an affirmative determination ofthe data obj ect being successfully written in the primary cache memory and in at least one ofthe primary disk memory and the secondary disk memory. 14. The system of claim 13, further including: a means for marking the secondary cache, the primary disk memory or the secondary disk memory as being out of sync based upon the checking of successful writing by the means for checking. 15. The system of claim 14, wherein: the marking means marks the secondary cache memory as being out of sync upon a determination that the data object was not successfully written therein. 16. The system of claim 14, wherein: the marking means marks the primary disk memory as being out of sync upon a determination that the data object was not successfully written therein. 17. The system of claim 16, further including: a means for designating the secondary disk memory as the primary disk memory upon a determination that the data object was not successfully written into the primary disk memory. 18. The system of claim 14, wherein: the marking means marks the secondary disk memory as being out of sync upon a determination that the data object was not successfully written therein. 19. The system of claim 13, further including: a means for alerting the client of a failed attempt to write the data object upon an affirmative determination ofthe data obj ect being unsuccessfully written to the primary disk memory and the secondary disk memory. 20. The method of claim 19, further including: a means for attempting to delete the data object from the primary cache memory following the alerting ofthe client of a failed attempt to write the data obj ect into the primary disk memory and the secondary disk memory. 21. The method of claim 20, further including: a means for determining whether the data object was successfully deleted from the primary cache memory; and a means for marking the primary cache memory as being out of sync upon a determination that the data object was unsuccessfully deleted from the primary cache memory following the affirmative determination that the data object was unsuccessfully written into the primary and secondary disk memories. 22. The system of claim 21 , further including: a means for re-designating the secondary cache memory as the primary cache memory upon a determination that the data object was unsuccessfully deleted from the primary cache memory following the affirmative determination that the data object was unsuccessfully written into the primary and secondary disk memories. 23. The method of claim 19, further including: a means for attempting to delete the data object from the secondary cache memory following the alerting ofthe client of a failed attempt to write the data object, upon a determination that the data object was successfully written into the secondary cache memory. 24. The method of claim 23, further including: a means for determining whether the data object was successfully deleted from the secondary cache memory; and a means for marking the secondary cache memory as being out of sync upon a determination that the data object was unsuccessfully deleted from the secondary cache memory following the affirmative determination that the data obj ect was unsuccessfully written into the primary and secondary disk memories. 25. The method of claim 13, wherein: the means for acknowledging is performed based upon the determination that the data object was successfully written to only one ofthe primary disk memory and the secondary disk memory. 26. A computer program product including a computer readable medium having computer readable program code means embodied thereon, for a database of a transactional processing system having a plurality of caches and a plurality of disk memories, the computer program product comprising: first computer readable program code means for receiving a memory update request from a client; second computer readable program code means for sequentially attempting to update the caches; third computer readable program code means for sequentially attempting to update the disk memories; fourth computer readable program code means for examining the attempts to update the caches and the disk memories, and determining a result ofthe memory update request based upon the examining; and fifth computer readable program code means for notifying the requesting client of the determination result; wherein the fourth computer readable program code means determines that the result is a successful memory update based upon the determination that the first cache which underwent the update attempt and at least one ofthe disk memories were successfully updated. 27. The computer program product of claim 26, further including: sixth computer readable program code means for marking the caches and disk memories which were unsuccessfully updated by the second and third computer readable program code means, respectively, as being out of sync. 28. The computer program product of claim 26, wherein: the fourth computer readable program code means determines that the result is a failed memory update based upon the determination that the first cache which underwent the update attempt was not successfully updated. 29. The computer program product of claim 26, further including: sixth computer readable program code means for deleting data relating to the memory update from the caches which were successfully updated by the second computer readable program code means, upon a determination by the fourth computer readable program code means that the result is an unsuccessful memory update. 30. The computer program product of claim 29, further including: seventh computer readable program code means for marking as being out of sync the caches having data relating to the memory update which was unsuccessfully deleted by the sixth computer readable program code means. 31. A method for replicating data in a database, the database including a plurality of caches and a plurality of disk memories, the method comprising the steps of: receiving a memory update request from a client; sequentially attempting to update the caches; sequentially attempting to update the disk memories following the step of sequentially attempting to update the caches; examining the attempts to update the caches and the disk memories, and determining a result ofthe memory updates; and notifying the requesting client ofthe determination result; and wherein the determination result is a successful memory update based upon an affirmative determination that the first cache which underwent the update attempt and at least one ofthe disk memories were successfully updated. 32. The method of claim 31, further including the step of: marking the caches and disk memories which were unsuccessfully updated as being out of sync. 33. The method of claim 31, further including the step of: deleting data relating to the memory update from the caches which were successfully updated, upon a determination that the result is an unsuccessful memory update. 34. The method of claim 33, further including the step of: marking as being out of sync the caches having data relating to the memory update which was unsuccessfully deleted during the step of deleting. 35. The method of claim 33, further including the step of: recording the unsuccessful deletion of data relating to the memory update from a cache.

Inventors: SMITH ROBERT, SMITH, ROBERT
Applicants: ERICSSON INC, ERICSSON INC.
Application year: 1999
Main classification: G06F11
IPC codes: G06F11, G06F12