System and method for automatically distributing copies of a replicated database in a computer system

Abstract: A computer implemented system, method and computer program product for automatically distributing copies of a replicated database (46, 48, 50) for a computer system is disclosed comprising at least first (22) and second (24) host computers. Each of the host computers operatively control at least one associated computer mass storage device controller (26 A , 26 B ; 28 A , 28 B ; 30 A , 30 B ) coupled to commonly accessible computer mass storage devices (32, 34, 36) by means of at least one storage device bus (38, 40, 42). The system and method comprises the step of enumerating each of the various host computers of the computer system (20), each of the computer mass storage device controllers associated with each host computer and each of the computer mass storage devices coupled to the storage device buses coupling the controllers. Copies of the replicated database are then automatically distributed across the computer mass storage devices such that failures of one or more of the computer mass storage device controllers or the computer mass storage devices will not interrupt operation of the replicated database in the computer system.

Description: The present invention relates, in general, to the field of computers and computer database systems incorporating a plurality of computer mass storage devices for storing data. More particularly, the present invention relates to a system and method for automatically distributing copies of a replicated database in a computer system. In a replicated computer database system, copies of the database (the "replicas") are distributed across various physical computer mass storage devices, such as individual disk drives, in order to ensure that the loss of a single drive does not compromise the contents of the database. In other words, replicated systems must guarantee that the most recent data is being presented to the system. Shared sets of disk drives in multi-host computer systems may comprise a pair of host computers and a plurality of associated disk drives, each storing a portion of the database. However, there has heretofore been no automated means for distribution of database replicas across the various system components to minimize the number of potential single points of failure. The distribution of the replicas has historically been a system administration function effectuated on an ad hoc basis and, as a consequence, its efficacy has been dependent on the knowledge and skills of a given system administrator. Moreover, the distribution of replicas in this manner can often result in the utilization of an excessive number of replicas to ensure data availability with a concomitant degradation in overall system performance. Document "Proceedings of the Symposium on Reliable Distributed Systems, Houston, Oct.5-7, 1992, No.Symp.11, 5 October 1992, Institute of Electrical and Electronics Engineers, pages 20-27, Paris J.-F. et Al." constitutes a relevant background art document since it discloses a dynamic group replication control protocol that adapts itself to site availability and network connectivity and manages the replication of data objects that must have more than five replicas. Set of replicas of a data object must be arranged with different read and write quorums. SUMMARY OF THE INVENTION The system and method of the present invention advantageously automates the distribution of replicas in a replicated database without relying solely on the system administrator to perform this function. While nevertheless allowing for the system administrator to exercise judgment in the final placement of replicas, the computer program implemented function disclosed herein provides a system and method of especial utility in the automated distribution of database replicas such that single points of failure are minimized. In order to effectuate this, the present invention provides a computer program product, system and method which first analyzes the organization of the computer mass storage devices and controllers attached to the computer system and then determines the optimal distribution of the replicas such that the failure of a one or more controllers, computer mass storage devices or groups thereof (the latter hereinafter referred to as "trays" in conjunction with the SPARCstorage™ Array ("SSA") series of computer mass storage disk drive arrays) will not result in a lack of database service. In a particular embodiment disclosed herein in conjunction with the DiskSuite™ computer program developed and licensed by Sun Microsystems, Inc., assignee of the present invention, the system, method and computer program product of the present invention will automatically distribute database replicas such that more than a single drive, tray or controller may be lost without compromising system integrity. Particularly disclosed herein is a computer implemented system and method, as claimed in claims 4 and 1, respectively, for automatically distributing replica copies of a replicated database for a computer system comprising at least first and second host computers. Each of the host computers operatively control at least one associated computer mass storage device controller coupled to commonly accessible computer mass storage devices by means of at least one storage device bus. The system and method comprises the step of enumerating each of the various host computers of the computer system, each of the computer mass storage device controllers associated with each host computer and each of the computer mass storage devices coupled to the storage device buses coupling the controllers. Based on the results of said enumeration, copies of the replicated database are then automatically distributed across the computer mass storage devices such that failures of one or more of the computer mass storage device controllers or the computer mass storage devices will not interrupt operation of a replica quorum of the replicated database remaining accessible in the computer system. Independent claim 6 defines the computer program product having computer readable code for performing said above method. BRIEF DESCRIPTION OF THE DRAWINGS The aforementioned and other features and objects of the present invention and the manner of attaining them will become more apparent and the invention itself will be best understood by reference to the following description of a preferred embodiment taken in conjunction with the accompanying drawings, wherein: Fig. 1 is a simplified representational drawing of a general purpose computer forming a portion of the operating environment of the present invention; Fig. 2 is a simplified conceptual representation of a computer system for possible utilization in conjunction with a replicated database comprising, for example, a pair of host computers H A and H B each having a number of storage controllers C 0 , C 1 and C 2 in operative association therewith each coupled to common computer mass storage device bus to which are coupled one or more computer mass storage devices (such as Winchester, "fixed", "rigid" or "hard" disk drives) collectively represented as devices D 0 , D 1 and D 2 respectively each having a portion thereof for storing a database replica R 0 , R 1 and R 2 ; Fig. 3 is a further conceptual representation of a computer system for possible utilization in conjunction with a replicated database comprising, for example, a number of SPARCstorage™ Array ("SSA") disk drive arrays SSA 0 , SSA 1 , SSA 2 each having a number of disk drive trays T 0 , T 1 and T 2 comprising, for example, six disk drives when utilized in conjunction with a Small Computer System Interface ("SCSI") computer mass storage bus; Fig. 4 is an additional conceptual representation of a computer system for possible utilization in conjunction with a replicated database comprising, for example, a pair of host computers H A and H B each having a pair of controllers C 0 and C 1 coupled to disk drive arrays SSA 0 and SSA 1 respectively having a plurality of distributed database replicas ("R") resident on certain of the disk drives of particular trays T 0 , T 1 and T 2 and wherein 50% of the trays have "failed" as indicated by the Xs through trays T 0 of SSA 0 and SSA 1 and tray T 1 of SSA 1 ; and Fig. 5 is a follow-on conceptual representation of the computer system of Fig. 4 showing, for example, the situation wherein an additional controller C 2 is associated with hosts H A and H B coupled to SSA 2 wherein tray T 2 thereof has failed and wherein 55% of the trays incorporating database replicas have not failed. Fig. 6 depicts the operation of the pseudo code of page 8, lines 22 to 42. DESCRIPTION OF A PREFERRED EMBODIMENT The environment in which the present invention is used encompasses the general distributed computing system, wherein general purpose computers, workstations or personal computers are connected via communication links of various types, in a client-server arrangement, wherein programs and data, many in the form of objects, are made available by various members of the system for execution and access by other members of the system. Some of the elements of a general purpose workstation computer are shown in Fig. 1, wherein a processor 1 is shown, having an input/output ("I/O") section 2, a central processing unit ("CPU") 3 and a memory section 4. The I/O section 2 may be connected to a keyboard 5, a display unit 6, a disk storage unit 9, a CDROM drive or unit 7 or a computer network 11 such as a wide area network ("WAN"), local area network ("LAN") or other network connection such as the Internet. The CDROM unit 7 can read a CDROM or CDROM medium 8 which typically contains programs 10 and data. The computer program products containing mechanisms to effectuate the apparatus and methods of the present invention may reside in the memory section 4, or on a disk storage unit 9 or on the CDROM 8 or network 11 of such a system. With reference additionally now to Fig. 2, a simplified conceptual representation of a computer system 20 for possible utilization in conjunction with a replicated database is shown. The computer system 20 comprises, for example, a pair of host computers H A 22 and H B 24 each having a number of storage controllers C 0 , C 1 and C 2 in operative association therewith. The controllers C 0 26 A , C 1 28 A and C 2 30 A are associated with host 22 while the controllers C 0 26 B , C 1 28 B and C 2 30 B are associated with host 24. The pairs of controllers C 0 , C 1 and C 2 are each coupled to respectively common computer mass storage device buses 38, 40 and 42 to which are coupled one or more computer mass storage device(s) (such as Winchester, "fixed", "rigid" or "hard" disk drives) collectively represented as devices D 0 32, D 1 34 and D 2 36 as shown. Each of the device(s) D 0 32, D 1 34 and D 2 36 have a portion thereof for storing a database replica R 0 46, R 1 48 and R 2 50. With reference additionally now to Fig. 3, a further conceptual representation of a computer system 20 for possible utilization in conjunction with a replicated database is shown. The computer system 20 is similar to that shown in Fig. 2 except that the representation of the devices 32, 34 and 36 (Fig. 2) have been expanded to, for example, a number of SPARCstorage™ Array ("SSA") disk drive arrays SSA 0 52, SSA 1 54, SSA 2 56 respectively. Each of the disk drive arrays SSA 0 52, SSA 1 54, SSA 2 56 have a number of disk drive trays T 0 , T 1 and T 2 comprising, for example, six disk drives, which is the maximum which can be utilized in conjunction with conventional SCSI computer mass storage buses 38, 40 and 42 respectively wherein each bus supports a total of eight initiator and target devices. Fast/Wide SCSI would allow for use with up to 14 target devices in conjunction with two initiator/hosts. The system and method herein disclosed may also be utilized, for example, in conjunction with a fiber channel connection in lieu of other bus architectures. With reference additionally now to Fig. 4, an additional conceptual representation of a computer system 60 for possible utilization in conjunction with a replicated database is shown. The computer system 60 comprises, for example, a pair of host computers H A 22 and H B 24 as previously described with respect to the preceding figures each having a pair of controllers C 0 26 A /26 B and C 1 28 A /28 B coupled to disk drive arrays SSA 0 52 and SSA 1 54 respectively. The disk drive arrays SSA 0 52 and SSA 1 54 are shown as having a plurality of distributed database replicas ("R") resident on certain of the disk drives of particular trays T 0 , T 1 and T 2 . In this example, exactly 50% of the trays have "failed" as indicated by the Xs through trays T 0 of SSA 0 52 and SSA 1 54 and tray T 1 of SSA 1 54 and exactly half of the previously available replicas are no longer accessible. As previously noted, replicated systems must guarantee that the most recent data is being presented to the computer system 60. The worst case scenario that must be detected and prevented if at all possible is a double replica failure, sometimes referred to as "split brain". The "split brain" scenario occurs when two identical copies of data are in use (e.g. "a" and "b"). At some point in time, assume "b" becomes unaccessible and "a" is in use. Thereafter, if "a" becomes unaccessible and "b" then becomes accessible and in use, "old" data can be unknowingly used. Even worse is the situation where "a" and "b" then both become accessible and in use wherein different data can be provided at different times with no updates being done between times. Utilizing the system and method of the present invention as embodied in the DiskSuite™ computer program, the "split brain" problem is obviated by replicating the database and requiring a "replica quorum". A replica quorum is achieved if at least HALF + 1 of the replicas are accessible. For example, if there are three or more replicas available on separate computer mass storage devices or controllers, then the database can sustain a single replica failure. In the example of Fig. 4, since a replica quorum cannot be obtained (i.e. only 50% of the replicas are available and not 50% + 1 replicas), then the system administrator must intervene to correct the problem so that "old" data and/or "garbage" data will not be used. With reference additionally now to Fig. 5, a follow-on conceptual representation of a computer system 70 which is built upon the computer system 60 of Fig. 4 is shown. The computer system 70 comprises, for example, an additional pair of controllers C 2 associated with hosts H A 22 (controller 30 A ) and H B 24 (controller 30 B ) which may have been later added to the computer system 60 (Fig. 4) or and original part thereof. In this example, the additional controllers 30 A and 30 B are coupled to SSA 2 56 by means of computer mass storage device bus 42 and tray T 2 thereof is additionally shown as having failed. In this example, (and unlike the computer system 60 of Fig. 4) more than 50% of the database replicas remain and approximately 55% of the trays incorporating database replicas have not failed. For this reason, a replica quorum is obtained since at least HALF + 1 of the replicas remain accessible. The following is a representative computer program pseudocode list which may be used to automate the allocation of replicas in a particular diskset configuration of possible use in conjunction with the DiskSuite™ computer program: FIG. 6 depicts the operation of the above pseudo code. This process begins at event 100 that enables function 101. At function 101 it is determined if the number of disk drive controllers in the computer system is less-than or equal-to 3 controllers. If the answer is "yes", the function 102 operates to determine if the controllers have different numbers of disk drive connected thereto. If "yes" the function 103 operates to set the number of database replicas per controller equal to the smallest number of disks on any controller, whereupon the process ends. For example, if the smallest number of disks on any controller is equal to 3 disks, then each controller is provided with 3 database replicas. Returning to function 102, if a "no" determination is made, then function 104 operates to determine if the number of disk drives per controller is less-than or equal-to 30 disk drives. If "yes", then above described function 103 is enabled to set the number of replicas per controller, and the process ends. A "no" output from either function 101 or function 104 enabled the operation of function 105. At function 105 it is determined if the number of SCSI chains in the controllers in the computer system is less-than or equal-to 25. If "yes", then function 106 is enabled to set the number of database replicas equal to 2 replicas for each SCSI chain in the computer system, and the process ends. When the output of function 106 is "no", function 107 is enabled to determine if the number of SCSI chains in the computer system is less-than or equal-to 50. A "yes" output from function 107 enables function 108 to set the number of replicas to be equal to 1 replica for each SCSI chain, and the process ends. When the output of function 107 is "no", function 109 is enabled to determine if the number of disk drive controllers in the computer system is less-than or equal-to 25. A "yes" output from function 109 enables function 110 to set the number of replicas to be equal to 2 replicas for each controller, and the process ends. When the output of function 109 is "no", function 110 is enabled to determine if the number of disk drive controllers in the computer system is less-than or equal-to 50. A "yes" output from function 111 enables function 112 to set the number of replicas to be equal to 1 replicas for each controller, and the process ends. When the output of function 111 is "no", function 113 is enabled to set the number of replicas to be equal to 1 replicas for each 50 controllers in the computer system, and the process ends. The following computer program source listing is a further example of a computer implemented method that may be utilized in conjunction with the DiskSuite™ program available from Sun Microsystems, Inc. to automate the allocation of replicas in a diskset: While there have been described above the principles of the present invention in conjunction with specific computer system configurations and methods for automatically distributing copies of a replicated database, it is to be clearly understood that the foregoing description is made only by way of example and not as a limitation to the scope of the invention. Particularly, it is recognized that the teachings of the foregoing disclosure will suggest other modifications to those persons skilled in the relevant art. Such modifications may involve other features which are already known per se and which may be used instead of or in addition to features already described herein. Although claims have been formulated in this application to particular combinations of features, it should be understood that the scope of the disclosure herein also includes any novel feature or any novel combination of features disclosed either explicitly or implicitly or any generalization or modification thereof which would be apparent to persons skilled in the relevant art, whether or not such relates to the same invention as presently claimed in any claim and whether or not it mitigates any or all of the same technical problems as confronted by the present invention.

Claims: A computer implemented method for automatically distributing replica copies of a replicated database (46, 48, 50) for a computer system comprising at least first and second host computers (22, 24), each of said host computers controlling at least one associated computer mass storage device controller (26 A , 26 B ; 28 A , 28 B ; 30 A , 30 B ) coupled to computer mass storage devices (32, 34, 36) commonly accessible by said at least first and second host computers by means of at least one storage device bus (38, 40, 42), the method comprising the steps of: enumerating each of said at least first and second host computers of said computer system, each of said at least one computer mass storage device controller and each of said computer mass storage devices coupled to said at least one storage device bus; and, based on the results of said enumeration, automatically distributing said copies of said replicated database (46, 48, 50) across said computer mass storage devices such that one or more failures of said at least one computer mass storage device controller or of said computer mass storage devices will not interrupt operation of a replica quorum of said replicated database remaining accessible in said computer system (20). The method of claim 1, wherein said replica quorum of said replicated database is only achieved if at least 50% + 1 of the replica copies are available. The method of claim 1 or claim 2, further comprising the step of: defining a layout of said computer system in accordance with said step of enumerating prior to said step of automatically distributing. A computer system (20) for automatically,distributing replica copies of a replicated database (46, 48, 50), said system comprising at least first (22) and second (24) host computers; at least first and second computer mass storage device controllers (26 A ; 28 A ; 30 A , 26 B ; 28 B , 30 B ) respectively controlled by each of said at least first and second host computers; a plurality of computer mass storage devices (32, 34, 36) coupled to said at least first and second computer mass storage device controllers by means of at least one common storage device bus (38, 40, 42); and a computer program operative in conjunction with one of said at least first and second host computers to enumerate each of said at least first and second host computers, each of said at least first and second computer mass storage device controllers and each of said computer mass storage devices, and, based on the results of said enumeration, to provide for automatically distributing copies of a replicated database across said plurality of computer mass storage devices such that one or more failures of said at least first and second computer mass storage device controllers or said plurality of computer mass storage devices will not interrupt operation of a replica quorum of said replicated database remaining accessible in said computer system. The computer system of claim 4, wherein said plurality of computer mass storage devices comprise disk drives. A computer program product comprising: a computer useable medium having computer readable code embodied therein for causing a computer to effect automatically distributing replica copies of a replicated database (46, 48, 50) for a computer system comprising at least first and second host computers (22, 24), each of said host computers controlling at least one associated computer mass storage device controller (26 A , 26 B ; 28 A , 28 B ; 30 A , 30 B ) coupled to computer mass storage devices (32, 34, 36) commonly accessible by said at least first and second host computers by means of at least one storage device bus (38, 40, 42), the computer program product comprising: computer readable program code devices configured to cause a computer to effect enumerating each of said at least first and second host computers of said computer system (20), each of said at least one computer mass storage device controller and each of said computer mass storage devices coupled to said at least one common storage device bus; and, based on the results of said enumeration, computer readable program code devices configured to cause a computer to effect automatically distributing said copies of said replicated database across said computer mass storage devices such that one or more failures of said at least one computer mass storage device controller or said computer mass storage devices will not interrupt operation of a replica quorum of said replicated database remaining accessible in said computer system. The computer program product of claim 6, further comprising: computer readable program code devices configured to cause a computer to effect defining a layout of said computer system in accordance with said step of enumerating prior to said step of automatically distributing.

Inventors: CUNLIFF JOSEPH E, PASSMORE DALE R, CUNLIFF, JOSEPH E., PASSMORE, DALE R.
Applicants: SUN MICROSYSTEMS INC, SUN MICROSYSTEMS, INC.
Application year: 1997
Main classification: G06F11
IPC codes: G06F11, G06F12