|Publication number||US20060036896 A1|
|Application number||US 11/203,489|
|Publication date||Feb 16, 2006|
|Filing date||Aug 12, 2005|
|Priority date||Mar 26, 1999|
|Also published as||EP1222540A1, EP1222540A4, EP1222540B1, US6401120, US6938084, US20020161889, WO2000058824A1|
|Publication number||11203489, 203489, US 2006/0036896 A1, US 2006/036896 A1, US 20060036896 A1, US 20060036896A1, US 2006036896 A1, US 2006036896A1, US-A1-20060036896, US-A1-2006036896, US2006/0036896A1, US2006/036896A1, US20060036896 A1, US20060036896A1, US2006036896 A1, US2006036896A1|
|Inventors||Rod Gamache, Michael Massa, Sunita Shrivastava, Gor Nishanov, David Lomet, Philip Bernstein, Rohit Jain|
|Original Assignee||Microsoft Corporation|
|Export Citation||BiBTeX, EndNote, RefMan|
|Patent Citations (27), Referenced by (23), Classifications (23), Legal Events (2)|
|External Links: USPTO, USPTO Assignment, Espacenet|
This is a continuation of U.S. patent application Ser. No. 09/895,810 filed Jul. 2, 2001, which is a continuation-in-part of U.S. patent application Ser. No. 09/277,450, filed Mar. 26, 1999.
The invention relates generally to computer network servers, and more particularly to computer servers arranged in a server cluster,
A server cluster ordinarily is a group of at least two independent servers connected by a network and utilized as a single system. The clustering of servers provides a number of benefits over independent servers. One important benefit is that cluster software, which is run on each of the servers in a cluster, automatically detects application failures or the failure of another server in the cluster. Upon detection of such failures, failed applications and the like can be terminated and restarted on a surviving server.
Other benefits of clusters include the ability for administrators to inspect the status of cluster resources, and accordingly balance workloads among different servers in the cluster to improve performance. Such manageability also provides administrators with the ability to update one server in a cluster without taking important data and applications offline for the duration of the maintenance activity. As can be appreciated, server clusters are used in critical database management, file and intranet data sharing, messaging, general business applications and the like.
When operating a server cluster, the cluster operational data (i.e., state) of any prior incarnation of a cluster needs to be known to the subsequent incarnation of a cluster, otherwise critical data may be lost. For example, if a bank's financial transaction data are recorded in one cluster, but a new cluster starts up without the previous cluster's operational data, the financial transactions may be lost. To avoid this, prior clustering technology required that each node (server) of a cluster possess its own replica of the cluster operational data on a private storage thereof, and that a majority of possible nodes (along with their private storage device) of a cluster be operational in order to start and maintain a cluster.
However, requiring a quorum of nodes has the drawback that a majority of the possible nodes of a cluster have to be operational in order to have a cluster. A recent improvement described in U.S. patent application Ser. No. 08/963,050, entitled “Method and System for Quorum Resource Arbitration in a Server Cluster,” assigned to the same assignee of the present invention, provides the cluster operational data on a single quorum device, typically a storage device, for which cluster nodes arbitrate for exclusive ownership. Because the correct cluster operational data is on the quorum device, a cluster may be formed as long as a node of that cluster has ownership of the quorum device. Also, this ensures that only one unique incarnation of a cluster can exist at any given time, since only one node can exclusively own the quorum device. The single quorum device solution increases cluster availability, since at a minimum, only one node and the quorum device are needed to have an operational cluster. While this is a significant improvement over requiring a majority of nodes to have a cluster, a single quorum device is inherently not reliable, and thus to increase cluster availability, expensive hardware-based solutions are presently employed to provide highly-reliable single quorum device for storage of the operational data. The cost of the highly-reliable storage device is a major portion of the cluster expense.
Briefly, the present invention provides a method and system wherein at least three storage devices (replica members) are configured to maintain the cluster operational data, and wherein the replica members are independent from any given node. A cluster may operate as long as one node possesses a quorum (e.g., a simple majority) of the configured replica members. For example, in a cluster having three replica members configured, at least two replica members need to be available and controlled by a node to have an operational cluster. Because a replica member can be controlled by only one node at a time, only one unique incarnation of a cluster can exist at any given time, since only one node may possess a quorum of members. The quorum requirement further ensures that a new or surviving cluster has at least one replica member that belonged to the immediately prior cluster and is thus correct with respect to the cluster operational data.
A quorum arbitration algorithm is provided, by which any number of nodes may arbitrate for exclusive ownership of the replica members (or a single quorum device). The quorum arbitration algorithm ensures that only one node may have possession of the quorum replica set when a cluster is formed, and also enables another node to represent the cluster when a node having exclusive possession of the quorum replica set fails. Arbitration may thus occur when a node first starts up, including when there is no cluster yet established because of a simultaneous startup of the cluster's nodes. Arbitration also occurs when a node loses contact with the owner of the quorum replica set, such as when the owner of the replica set fails or the communication link is broken, as described below.
In one implementation, arbitration is based on challenging (or defending) for an exclusive reservation of each replica member, and a method for releasing an exclusive reservation is provided. In this implementation, the arbitration process leverages the SCSI command set in order for systems to exclusively reserve the SCSI replica members' resources and break any other system's reservation thereof. A preferred mechanism for breaking a reservation is the SCSI bus reset, while a preferred mechanism for providing orderly mutual exclusion is based on a modified fast mutual exclusion algorithm in combination with the SCSI reserve command. Control of the cluster is achieved when a quorum of replica members is obtained by a node. The algorithm enables any number of nodes to arbitrate for any number of replica members (or for a single quorum device).
A quorum replica set algorithm is also provided herein to ensure the consistency of data across replica members in the face of replica or node failures. The quorum replica set algorithm provides a database that is both fault tolerant and strongly consistent. The quorum replica set algorithm ensures that changes that were committed in a previous incarnation of the cluster remain committed in the new incarnation of the cluster. Among other things, the quorum replica set algorithm maintains the consistency of data across the replica set as replica members become available (online) or unavailable (offline) to the set. To this end, the quorum replica set algorithm includes a recovery process that determines the most up-to-date replica member from among those in the quorum, and reconciles the states of the available members by propagating the data of that most up-to-date replica member to the other replica members when needed to ensure consistency throughout the replica set. For example, the quorum replica set algorithm propagates the data to update replica members following a cluster failure and restart of the cluster, when a replica member becomes available for use in the replica set (upon the failure and recovery of one or more members), or a change in node ownership of the replica set. The quorum replica set algorithm also handles reads and updates in a manner that maintains consistency, such as by preventing further updates when less than a majority of replica members are successfully written during an update.
The method and system of the present invention require only a small number of relatively inexpensive components to form a cluster, thereby increasing availability relative to a quorum of nodes solution, while lowering cost and increasing reliability relative to a single quorum device solution.
Other benefits and advantages will become apparent from the following detailed description when taken in conjunction with the drawings, in which:
Exemplary Operating Environment
With reference to
A number of program modules may be stored on the hard disk, magnetic disk 29, optical disk 31, ROM 24 or RAM 25, including an operating system 35 (which may be considered as including or operatively connected to a file system), one or more application programs 36, other program modules 37 and program data 38. A user may enter commands and information into the personal computer 20 through input devices such as a keyboard 40 and pointing device 42. Other input devices (not shown) may include a microphone, joystick, game pad, satellite dish, scanner or the like. These and other input devices are often connected to the processing unit 21 through a serial port interface 46 that is coupled to the system bus, but may be connected by other interfaces, such as a parallel port, game port or universal serial bus (USB). A monitor 47 or other type of display device is also connected to the system bus 23 via an interface, such as a video adapter 48. In addition to the monitor 47, personal computers typically include other peripheral output devices (not shown), such as speakers and printers.
The personal computer 20 operates in a networked environment using logical connections to one or more remote computers 49. At least one such remote computer 49 is another system of a cluster communicating with the personal computer system 20 over the networked connection. Other remote computers 49 may be another personal computer such as a client computer, a server, a router, a network PC, a peer device or other common network system, and typically includes many or all of the elements described above relative to the personal computer 20, although only a memory storage device 50 has been illustrated in
A preferred system 20 further includes a host adapter 55 or the like which connects the system bus 23 to a SCSI (Small Computer Systems Interface) bus 56 for communicating with a quorum replica set 57 (
As used herein, a “replica member” is a storage device that is not private to any specific node, but rather is able to be utilized by any node of the cluster at various times. In other words, a replica member can operate in a cluster regardless of which node or nodes are in that particular incarnation thereof. Each replica member may be a simple disk, or some or all of them may be a hardware-based redundant array of devices, although as will become apparent, a benefit of the present invention is that such hardware-based redundancy is unnecessary. Note that any number of replica members (i.e., greater than two in the present invention) may be configured in a given cluster configuration, however for purposes of simplicity only three are shown in
Cluster Service Components
An administrator typically works with groups, each group being a collection of resources (e.g., cluster application resources, names, addresses and so forth) organized to allow an administrator to combine resources into larger logical units and manage them as a unit. Group operations performed on a group affect all resources contained within that group. Usually a group contains all of the elements needed to run a specific application, and for client systems to connect to the service provided by the application. For example, a group may include an application that depends on a network name, which in turn depends on an Internet Protocol (IP) address, all of which are collected in a single group. In a preferred arrangement, the dependencies of all resources in the group are maintained in a directed acyclic graph, known as a dependency tree. Dependency trees are described in more detail in U.S. patent application Ser. No. 08/963,049 entitled “Method and System for Resource Monitoring of Disparate Resources in a Server Cluster,” assigned to the same assignee as the present invention.
A cluster service 66 controls the cluster operation on a server cluster 59 (e.g.,
Nodes 60 1-60 n in the cluster 59 have the same view of cluster membership, and in the event that one node detects a communication failure with another node, the detecting node broadcasts a message to nodes of the cluster 59 causing other members to verify their view of the current cluster membership. This is known as a regroup event, during which writes to potentially shared devices are disabled until the membership has stabilized. If a node does not respond, it is removed from the cluster 59 and its active groups are failed over (“pulled”) to one or more active nodes. Note that the failure of the cluster service 66 also causes its locally managed resources to fail.
The cluster service 66 also includes a configuration database manager 76 which implements the functions that maintain a cluster configuration database on local storage devices 98 1-98 n (
A logging manager 78 provides a facility that works with the database manager 76 of the cluster service 66 to maintain cluster state information across a situation in which a cluster shuts down and a new cluster is later formed with no nodes necessarily being common to the previous cluster, known as a temporal partition. The logging manager 78 operates with the log file, preferably maintained in the replica members 58 1-58 3, to unroll logged state changes when forming a new cluster following a temporal partition.
A failover manager 80 makes resource/group management decisions and initiates appropriate actions, such as startup, restart and failover. The failover manager 80 is responsible for stopping and starting the node's resources, managing resource dependencies, and for initiating failover of groups.
The failover manager 80 receives resource and node state information from at least one resource monitor 82 and the node manager 68, for example, to make decisions about groups. The failover manager 80 is responsible for deciding which nodes in the cluster 59 should “own” which groups. Those nodes that own individual groups turn control of the resources within the group over to their respective failover managers 80.
An event processor 83 connects the components of the cluster service 66 via an event notification mechanism. The event processor 83 propagates events to and from cluster-aware applications (e.g., 84) and to and from the components within the cluster service 66. An object manager 88 maintains various cluster objects. A global update manager 90 operates to provide a global, atomic and consistent update service that is used by other components within the cluster service 66. The global update protocol (GLUP) is used by the global update manager 90 to broadcast updates to each node 60 1-60 n in the cluster 59. GLUP generally comprises a standard global update message format, state information maintained in each node, and a set of rules that specify how global update should be processed and what steps should be taken when failures occur.
In general, according to the GLUP protocol, one node (e.g. 60 1 of
A resource monitor 82 runs in one or more processes that may be part of the cluster service 66, but are shown herein as being separate from the cluster service 66 and communicating therewith via RPC or the like. The resource monitor 82 monitors the health of one or more resources (e.g., 92 1-92 4) via callbacks thereto. The monitoring and general operation of resources is described in more detail in the aforementioned U.S. patent application Ser. No. 08/963,049.
The resources (e.g., 92 1-92 4) are implemented as one or more Dynamically Linked Libraries (DLLs) loaded into the address space of the Resource Monitor 82. For example, resource DLLs may include physical disk, logical volume (consisting of one or more physical disks), file and print shares, network addresses and names, generic service or application, and Internet Server service DLLs. The resources 92 1-92 4 run in the system account and are considered privileged code. Resources 92 1-92 4 may be defined to run in separate processes, created by the cluster service 66 when creating resources, or they may be run in a common process.
Resources expose interfaces and properties to the cluster service 66, and may depend on other resources, with no circular dependencies allowed. If a resource does depend on other resources, the resource is brought online after the resources on which it depends are already online, and is taken offline before those resources. Moreover, each resource has an associated list of nodes in the cluster 59 on which this resource may execute. For example, a disk resource may only be hosted on nodes that are physically connected to the disk. Also associated with each resource is a local restart policy, defining the desired action in the event that the resource cannot continue on the current node.
Nodes 60 1-60 n in the cluster 59 need to maintain a consistent view of time. A time function suitable for this purpose is available in the Windows® 2000 operating system, however in other implementations one of the nodes may include a resource that implements a time service.
From the point of view of other nodes in the cluster 59 and management interfaces, nodes in the cluster 59 may be in one of three distinct states, offline, online or paused. These states are visible to other nodes in the cluster 59, and thus may be considered the state of the cluster service 66. When offline, a node is not a filly active member of the cluster 59. The node and its cluster service 66 may or may not be running. When online, a node is a fully active member of the cluster 59, and honors cluster database updates, maintains heartbeats, and can own and run groups. Lastly, a paused node is a fully active member of the cluster 59, and thus honors cluster database updates and maintains heartbeats. Online and paused are treated as equivalent states by most of the cluster software, however, a node that is in the paused state cannot honor requests to take ownership of groups. The paused state is provided to allow certain maintenance to be performed.
Note that after initialization is complete, the external state of the node is offline. To join a cluster 59, following the restart of a node, the cluster service 66 is started automatically. The node configures and mounts local, non-shared devices. Cluster-wide devices are left offline while booting, because they may be in use by another node. The node tries to communicate over the network with the last known members of the cluster 59. When the node discovers any member of the cluster 59, it performs an authentication sequence wherein the existing cluster node authenticates the newcomer and returns a status of success if authenticated, or fails the request if not. For example, if a node is not recognized as a member or its credentials are invalid, then the request to join the cluster 59 is refused. If successful, the newcomer may be sent an updated copy of the shared database or databases. The joining node may use the one or more databases to find shared resources and to bring them online as needed, and also to find other cluster members. If a cluster is not found during the discovery process, a node will attempt to form its own cluster, by acquiring control of a quorum of the replica devices in accordance with one aspect of the present invention, as described below.
Once online, a node can have groups thereon. A group can be “owned” by only one node at a time, and the individual resources within a group are present on the node that currently owns the group. As a result, at any given instant, different resources within the same group cannot be owned by different nodes across the cluster 59. Groups can be failed over or moved from one node to another as atomic units. Each group has a cluster-wide policy associated therewith comprising an ordered list of owners. A group fails over to nodes in the listed order.
For example, if a resource (e.g., an application) fails, the failover manager 80 may choose to restart the resource, or to take the resource offline along with any resources dependent thereon. If the failover manager 80 takes the resource offline, the group is restarted on another node in the cluster 59, known as pushing the group to another node. A cluster administrator may also manually initiate such a group transfer. Both situations are similar, except that resources are gracefully shutdown for a manually initiated failover, while they are forcefully shut down in the failure case.
When an entire node in the cluster 59 fails, its groups are pulled from the failed node to another node. This process is similar to pushing a group, but without the shutdown phase on the failed node. To determine what groups were running on the failed node, the nodes maintain group information on each node of the cluster 59 in a database or the like (in-memory or persistent) to track which nodes own which groups. To determine which node should take ownership of which groups, those nodes capable of hosting the groups negotiate among themselves for ownership, based on node capabilities, current load, application feedback and/or the group's node preference list. Once negotiation of a group is complete, all members of the cluster 59 update their databases to properly reflect which nodes own which groups.
When a previously failed node comes back online, the failover manager 80 decides whether to move some groups back to that node, in an action referred to as failback. To automatically failback, groups require a defined preferred owner. There may be an ordered list of preferred owners in a cluster of more than two nodes. Groups for which the newly online node is the preferred owner are pushed from the current owner to the new node. Protection, in the form of a timing window, is included to control when the failback occurs.
Node Arbitration and Consistent Cluster Operational Data VIA a Quorum of Replicas
In accordance with one aspect of the present invention, the information needed to form and operate a cluster, i.e., the cluster operational data, is replicated to a quorum replica set 57 of the replica members (e.g., 58 1-58 3 of
To create a new cluster, a system administrator runs a cluster installation utility on a system (node) that then becomes a first configured member of the cluster 59. For a new cluster 59, a total replica set 106 of replica members is created, each member including a database (e.g., 100 1,
More particularly, as shown in
In accordance with one aspect of the present invention, to form a cluster when a plurality of replica members are configured, a node has to obtain access to a quorum of the replica members 58 1-58 n, e.g., at least a simple majority of the total configured replica set 106. As described above, the replica members 58 1-58 3 include the cluster operational data on respective databases 100 1-100 3 (
By way of example,
In keeping with the invention, any node may form a cluster following a temporal partition, regardless of the number of functioning nodes, since by effectively separating the cluster operational data from the nodes, there is no requirement that a majority of nodes be operational. Thus, for example, in
More particularly, because only one node may have possession of the quorum replica set when a cluster is formed, and also because a node having exclusive possession thereof may fail, there is provided a method for arbitrating for exclusive ownership of the replica members, typically by challenging (or defending) for an exclusive reservation of each member. A method for releasing an exclusive reservation may also be provided. Arbitration may thus occur when a node first starts up, including when there is no cluster yet established because of a simultaneous startup of the cluster's nodes. Arbitration also occurs when a node loses contact with the owner of the quorum replica set, such as when the owner of the replica set fails or the communication link is broken, as described below. Arbitration for and exclusive possession of a single quorum device by two nodes are described in detail in the aforementioned U.S. patent application Ser. No. 08/963,050.
In accordance with another aspect of the present invention, the arbitration/exclusive ownership process has been extended to accommodate a cluster of more than two nodes. Although the algorithm described herein is capable of arbitrating for control of a replica set with a plurality of members, it should be noted that the multiple node arbitration algorithm is applicable to clusters having a single quorum device as the resource. For example, in such an event, the “majority” can be considered as one member available out of a total configured set of one, and, although some simplification to the algorithm is possible when there is only one device in contention, the general principles are essentially the same.
In general, to obtain control over the members of the quorum replica set 57 1, an arbitration process leverages a resource reservation mechanism such as the SCSI command set or the like in order for systems to exclusively reserve the (e.g., SCSI) replica members' resources and break any other system's reservation thereof. Control is achieved when a quorum of replica members is obtained by a node. A preferred mechanism for breaking a reservation is the SCSI bus reset, while a preferred mechanism for providing orderly mutual exclusion is based on a modified fast mutual exclusion algorithm in combination with the SCSI reserve command. One such algorithm is generally described in the reference entitled, “A Fast Mutual Exclusion Algorithm,” Leslie Lamport, ACM Transactions on Computer Systems, 5(1), (February 1987), although such an algorithm needs to be modified (among other things) to make it work properly in an asynchronous system such as a cluster.
Step 800 of
A first possible outcome to the read request is that the read will fail (as detected at step 90 4) because another node (e.g., 60 2) has previously placed (and not released) a reservation on the quorum member 58 1. At this time, there is a possibility that the other node 60 2 that has exclusive control of the quorum replica member 58 1 has stopped functioning properly, and consequently has left the replica member 58 1 in a reserved (locked) state. Note that the nodes 60 1 and 60 2 are not communicating, and thus there is no way for node 60 1 to know why the communication has ceased, e.g., whether the other node 60 2 has crashed or whether the node 60 1 itself has become isolated from the cluster 59 due to a communication break. Thus, in accordance with another aspect of the present invention, the arbitration process includes a challenge-defense protocol to the ownership of the members of the quorum replica set 57 1 that can shift representation of the cluster from a failed node 60 2 to another node 60 1 that is operational.
To accomplish the challenge portion of the process, if the read failed, at step 906, the challenging node 60 1 first uses the SCSI bus reset command to break the existing reservation of the quorum replica member 58 1 held by the other node 60 2. Next, after a bus settling time (e.g., two seconds) at step 908, the node 60 1 saves the unique myseq identifier to a local variable old_y and attempts to write the myseq identifier to the y-variable location on the replica member 58 1. Note that the write operation may fail even though the reservation has been broken because another node may have exclusively reserved the replica member 58 1 (via its own arbitration process) between the execution of steps 906 and 910 by the node 60 1. If the write fails at step 912, the node 60 1 knows that another node is competing for ownership, whereby the node 60 1 backs off by failing the arbitration and appropriately returning with a “FALSE” success code. Note that the write may also fail if the replica member has failed, in which event it cannot be owned as a quorum member, whereby the “FALSE” return is also appropriate.
However, if the write was successful as determined at step 912, the arbitration process of the node 60 1 continues to step 914 where the challenging node 60 1 delays for a time interval equal to at least two times a predetermined delta value. As described below, this delay gives a defending node an opportunity to persist its reservation of the replica member 58 1 and defend against the challenge. Because nodes that are not communicating cannot exchange node time information, the delta time interval is a fixed, universal time interval previously known to the nodes in the cluster, at present equal to a three-second arbitration time, and a bus-settling time of two seconds. Note, however that one bus settling time delay was already taken at step 908, and thus step 914 delays for double the arbitration time but only one additional bus settling time, e.g., eight more seconds. After this delay, step 920 again attempts to read the y-variable from the replica member 58 1.
Returning to step 904, if the reading of the y-variable was successful, then no node had a reservation on the replica member 58 1 and the local variable old_y is set to the y-variable (step 916) that was read. However, it is possible that the read was successful because it occurred just after another arbitrating node broke the exclusive reservation of a valid, operational owner. Thus, before giving the node 60 1 exclusive control (ownership) of the replica member 58 1, step 916 branches to step 918 to delay for a period of time sufficient to enable the present exclusive owner, (if there is one), enough time (e.g., the full two-delta time of ten seconds) to defend its exclusive ownership of the current member. After the delay, step 918 continues to step 920 to attempt to re-read the y-variable.
Regardless of the path taken to reach step 920, if the read at step 920 failed as determined by step 922, then the arbitration is failed because some node reserved the replica member 58 1. Alternatively, if at step 92 4 the member's y-variable that was read changed from its value preserved in the local old_y variable, then a competing node appears to be ahead in the arbitration process, and the node 60 1 backs off as described below so that the other node can obtain the quorum. However, if the y-variable has not changed, it appears that no node is able to defend the replica member 58 1 and that the node 60 1 may be ahead in the arbitration, whereby at step 924 the arbitration process continues to step 1000 of
Note that it is possible for a plurality of nodes to successfully complete the challenge procedure of
If y is still unchanged at step 1004, step 1006 generates a new unique myseq sequence identifier for the node 60 1 into the y location on the replica member 58 1, and if successful, continues to step 1008 where the value at the x location is read. If at step 1010 the x location still maintains the my_id value (written at step 1000), then this node 60 1 has won the arbitration, reserves the disk at step 1016 and returns with a success return code of “TRUE.” Alternatively, if at step 1010, the x location no longer maintains the ID of the node 60 1, then apparently another node (e.g., 60 4) is also challenging for the right to obtain exclusive control. However, it is possible that the other node 60 4 has changed the x value but then backed off because the y-value was changed, (e.g., at its own steps 1002-1004), whereby the node 60 1 is still the leader. Thus, after a delay at step 1012 to give the other node time to write to the y-location or back off, the y-value is read, and if the y value is changed at step 1014, then the arbitration was lost. Note that a node which wins the arbitration writes the y-location immediately thereafter as described below with reference to
Conversely, if the y value is still equal to the unique sequence ID (myseq) of the node 60 1 at step 1014, then this node 60 1 has won the arbitration, and returns with the “TRUE” success return code. Note that the mutual exclusion mechanism of steps 1000-1014 (run by each competing node) ordinarily ensures that only one node may ever reach step 1016 to persist the reservation, because only the node having its ID in the y-location can enter this critical section, while the x-location is used to determine if any other nodes are competing for the y-location. However, there is a non-zero probability that more than one node will successfully complete the arbitration procedure, given arbitrary processing delays. This is because fast mutual exclusion depends on the delay at step 1012 being long enough to guarantee that the participants that evaluated the condition at step 1004 as true are able to write down their sequence number to the disk at step 1006. However, if an unexpected delay occurs between steps 1004 and 1006 that is larger than the delay of step 1012, then more than one node could have successfully complete the arbitration procedure. This unlikely problem is made even less likely by the fact that a node places a SCSI reservation on a replica set member after successfully completing arbitration, as will be discussed later with reference to
If at step 806 it is determined that the challenging node 60 1 was successful in obtaining control of the replica member 58 1, step 806 branches to step 810. At step 810, the array tracking the node's control of this member is set to “TRUE,” the count used for determining a quorum is incremented, and the replica member 58 1 is set to be defended by the node 60 1 if the node 60 1 is able to achieve control over a quorum of the members. Defense of an owned member is described below with reference to
Step 820 of
If a quorum is not achieved, step 820 branches to step 822 to relinquish control of any replica members that the node 60 1 obtained ownership over, recompute the delay interval, and increment the retry (loop) counter. Step 824 then repeats the process after the delay interval at step 826 by returning to step 802 of
BackoffTime=BackoffTime0*(EˆA n)*Rand ( )+BackoffTimeMin,
where BackoffTime0 is the maximum backoff time for the first try, E is a number greater than 1, typically 2 for convenience, n is the retry number (0 based), ˆ represents exponentiation (raised to the power), BackoffTimeMin is the smallest practical backoff time, and Rand ( ) is a function that returns a random number between 0 and 1.
If no quorum is achieved after retrying, the process ultimately returns to step 504 with a failure status. Steps 504 and 506 will repeat the attempt to join an existing cluster or start the formation attempt over again, until some threshold number of failures is reached, whereby some action such as notifying an administrator of the failure may take place.
It should be noted that
Returning to step 602 of
The failure of any read or write operation on a quorum replica set member during this recovery procedure is treated as a failure of the replica member, (although the operation may be optionally retried some number of times before declaring failure). A failed replica member is removed from the quorum replica set, as described below with reference to
If the reconciliation of the members at step 602 is determined to be successful at step 604, the process returns to step 504 of
Step 700 of
If not a shutdown event, step 702 of
As shown at step 1100 of
If successful in reserving the disk, step 1104 is next executed where a new myseq value is generated for this node 60 2 and an attempt is made to write to write the y-variable used in the arbitration process, as described above. The y-variable is essentially rewritten to cause other nodes that are monitoring the y-value after breaking the previous reservation to back off, as also described above. If the write succeeds, the replica member was successfully defended, and the process returns to step 726 of
Returning to step 726 after attempting to defend the members, if the node 60 2 no longer has a quorum, the node returns to step 508 of
Alternatively, if at step 740 the node successfully acquired control over a quorum of replica members, step 744 is executed to reconcile the quorum members and form the cluster as described above. If successful in reconciling the members, the node 60 1 returns to
In alternative implementations, not all of the cluster operational data need be maintained in the replica members 58 1-58 3, only the data needed to get the cluster up and running, as described in the aforementioned copending U.S. patent application entitled “Data Distribution in a Server Cluster.” In one such alternative implementation, the replica members maintain this “core-boot” data, and also maintain information regarding the state of the other cluster operational data, (e.g., configuration information about the applications installed on the cluster and failover policies). The state information ensures the integrity of the other cluster operational data, while the other storage device or devices (e.g., a mirror set of storage elements) that store this data provide a relatively high-performance and/or lower cost storage for this additional cluster configuration information, with high reliability. In any event, as used herein, the replica members 58 1-58 3 maintain at least enough information to get a cluster up and running, but may store additional information as desired.
Note that a quorum need not be a simple majority, but may, for example, be some other ratio of operational members to the total number, such as a supermajority (e.g., three of four or four of five). However, a primary benefit of the present invention is to provide availability with the minimum number of components, and such a supermajority requirement would tend to reduce availability.
Instead, cluster availability may be increased by requiring only a simple majority while using a larger number of devices. For example, three replica members may be configured for ordinary reliability, in which two disks will have to fail to render the cluster unavailable. However, the more that reliability is desired, the more replica members may be used, (at a cost tradeoff), e.g., three of five failures is less likely than two of three, and so on. Note that SCSI limitations as to the number of replica members and their physical separation need not apply, as described in U.S. patent application Ser. No. 09/260,194 entitled “Method and System for Remote Access of Network Devices,” assigned to the same assignee as the present invention.
The Quorum Replica Set Algorithm
While having a set of multiple replica members increases cluster availability and reliability over a single quorum device, having a replica set requires providing consistency across the members of the replica set. This consistency needs to be maintained even though individual replica members can fail and recover at various times.
In accordance with another aspect of the present invention, to keep a replica set consistent in view of replica failures and recoveries, (and also following a temporal partition), a quorum replica set (QRS) algorithm is provided that among other things, performs a recovery process whenever a change to a replica set occurs, (that is, any time a formerly unavailable replica member becomes available). The QRS algorithm also prevents updates when less than a quorum of replica members is available. To this end, as part of the QRS algorithm, any time a write occurs to a replica member, (described below with respect to
The QRS algorithm is capable of being run on any node that is capable of representing the cluster via ownership of the quorum replica set 57. The QRS algorithm may be run during startup as replica members are detected, e.g., to bring those members online, and is also run during normal execution, such as by the node that possesses the quorum replica set 57, to ensure that replica members that come online or go offline are properly dealt with, and to ensure that data updates only occur when a quorum of configured members exists. For purposes of simplicity, the QRS algorithm will be primarily described with respect to its operation after a cluster has already been formed.
The QRS algorithm includes three properties. A first property is that configuration information updates that are applied to a majority of the members of a replica set will never be undone or lost despite the subsequent failure and recovery of replica set members and/or nodes executing the QRS algorithms. A second property is that an update that was recorded to some of the replica members but not committed in a previous recovery, or an update that was made without the knowledge of a previously committed update in a later epoch, will not get committed during recovery. A third property is that an update is reported to have succeeded if and only if the update was applied to a quorum of the replica members. Thus, if an update was in progress when a failure occurred, but had not yet been applied to a quorum of the replica members, then its fate cannot be known until recovery is complete. Such an update may be either committed or discarded during the recovery procedure. When an update is committed to at least the quorum, the update is reported to the cluster as having been successfully committed. Such reports (commit notifications) are generated in the same order in which the updates occur.
In order to ensure replica consistency, the QRS algorithm uses a log (a standard database technique) that logs the updates in records on each replica member, including three variables associated with the logged information. For example, in the three-member configured replica set generally represented in
A second variable used by the QRS algorithm is an update epoch number. The update epoch number is stored with each logged record to associate that update record with the current replica epoch value at the time the update record was logged. In
A third variable is a log sequence number, that tracks the relative sequence of each logged update record with respect to other logged update records. In
The QRS algorithm will be described herein with reference to the general flow diagrams of
Step 1402 prevents updates from occurring during operation of the replica online process, such as by setting an update variable to FALSE. For example, as will be described below, the update process of
Step 1404 increments a count of the number of available replicas, to reflect the detection of the newly-available replica that triggered operation of
If however a majority of replicas are available (step 1408), then a recovery process is started, as generally represented via
Following recovery, step 1410 of
If the replica is not already initialized at step 1600, then the log file is opened at step 1602. If the log is not new, then it is mounted via steps 1606, 1608 and 1610, by reading the log header (e.g., as a variable) into the owning node's local storage, verifying the validity of the log records (by evaluating checksums maintained with each record, or the like), and then setting a sequence number (e.g., as a variable) in the owning node's local storage equal to the sequence number of the last valid record in the log. Note that if the read at step 1606 fails, step 1607 aborts the recovery and takes this replica offline as described below with reference to
If the log was just created, then it is initialized via steps 1612, 1614 and 1616, including initializing its local replica epoch and sequence variables to zero, and writing the epoch data to the replica log header. The process then advances to step 1620 (entry Point 1) of
At step 1620 of
Step 1502 of
Step 1506 represents the reading of the last two valid records (one record if only one record exists, e.g., the starter record) from the log of each available replica. Again, although not specifically shown, a read failure results in the abort recovery process of
At step 1508, from among the replicas, the replica (or replicas) having a last record with the highest update epoch number is chosen as a candidate for leader. If at step 1510 only one replica has the highest epoch number in its last record, there is only one candidate for the leader replica, and it is selected as the leader at step 1512. In the event of a tie in record epochs, at step 1514, a leader is selected from the leader candidates based on the highest log sequence number in its last record. In other words, the leader is a replica member having in its last record an epoch.sequence number greater than or equal the maximum epoch.sequence number of the last record on the available replicas. Note that if two or more candidates replicas have the same sequence number, any one of those can serve as the leader replica since each have the same last record, however another tiebreaker may be used based on some other criteria if desired. For example, if an epoch.sequence tie exists, the replica with the log having the lowest log identifier becomes the leader replica. Further, if all available replicas each the same epoch and sequence number for their respective last record, then no propagation of records (
Once a leader replica is selected, the recovery process continues to
Step 1522 selects a replica that is not the leader for updating. Based on the last two records therein (previously read via step 1502), the records that are needed to update that non-leader replica relative to the leader replica are determined at step 1524. These records, referred to as the set of records to update, or recordset, will be propagated to the selected non-leader replica via the process of
During the propagation, the last two records on the non-leader replicas need to be examined with respect to the records being propagated by the leader replica, because the last record may correspond to an update that was made to this replica but that was not committed to a majority of the replicas and now conflicts with an update committed in a later epoch, while the second last record may have been retagged in a previous unsuccessful recovery session. This part of the QRS algorithm, shown in
More particularly, step 1700 of
If instead step 1700 determines that the second to last record on the selected non-leader replica exists, then step 1700 braches to step 1710 where the second to last record in the selected non-leader replica is evaluated against the first record of the leader's propagated recordset. If the same, step 1710 branches to step 1712 to evaluate the last record of the selected non-leader replica against the second record of the leader's propagated recordset. If these are not the same, then the last record of the non-leader replica is atomically replaced by the second record of the leader's propagated recordset at step 1714. Any remaining propagated records are then applied via step 1716. If instead step 1712 determines that the epoch and sequence for the records match, step 1712 branches to step 1718 wherein any remaining propagated records are then applied.
Returning to step 1710, if the second to last record in the selected non-leader replica is not the same as the first record of the leader's propagated recordset, step 1710 branches to step 1720 where the last record of the non-leader replica is discarded. Step 1722 then replaces the second to last record of the non-leader replica with the first record in the leader's propagated recordset, and then step 1724 applies any remaining propagated records from the leader's propagated recordset to the selected non-leader replica.
The process of
When the non-leader replicas have been made consistent with the leader replica, step 1530 is performed to report (generate the commit notifications for) the successful committing of the last record transmitted from the leader replica. For efficiency, such commit notifications only have to be generated for records propagated since the last recovery.
At this time, recovery is complete, and step 1532 returns to step 1410 of
As mentioned above, if any read or write failure to a replica occurs during the recovery process, the abort recovery process of
If updates are allowed, step 2004 instead branches to step 2010 wherein an attempt to make the update is made, e.g., a data write attempt, to each available replica member.
At step 2100 of
Step 2112 evaluates whether the write was successful. Note that although not shown, any writes to the replica member are not to be cached but instead written through to the disk. If the record is successfully written (and flushed) to the disk, a TRUE status is returned (to step 2012 of
Steps 2012 through 2020 of
When a write status has been returned from
If instead at step 2022 a majority was successfully written, step 2026 is executed which reports that this record was successfully committed. Step 2028 re-enables further updates since a majority of writes were known to be successful. A TRUE is returned via step 2030, and the update lock is released via step 2032.
Step 2202 decrements a count of the number of available replicas, and step 2204 removes the identifier of this replica from the set that tracks which replicas are currently available, to reflect that this replica is no longer available. Note that steps 2202 and 2204 are essentially counter to the steps 1404 and 1406 that are described above for when a replica becomes available. Step 2206 forces the log variable in the recovery structure to be initialized again when the replica subsequently comes online by setting a variable or the like for this replica. As described above, this variable is evaluated at step 1600 of
Sep 2208 represents the test for whether a quorum (e.g., majority) still exist based on the count that remains versus the number required for a majority. If there is not a majority, step 2208 branches to step 2210 to disable updates. If there is a majority, step 2208 instead branches to step 2212 to allow updates. After either step, the offline process continues to step 2214 to release the update lock, after which the replica offline process ends.
As also represented in
Sometime later, as generally represented in
In the last part of the example, generally represented in
The above description and accompanying examples are directed to handling replica members becoming available or unavailable when the total configured replica set is constant. However, the QRS algorithm can also handle the situation wherein new, previously unknown replica members are added to the total configured replica set, or when previously configured members are removed from the total configured replica set.
As can be readily appreciated, changing the number of replica members in the total configured replica set changes the majority requirement, which if done incorrectly could cause a significant problem. When adding replica members, care must be taken to ensure that in the event of a cluster or replica member failure during the addition process, a subsequent majority cannot be allowed without at least one member present from the prior epoch. For example, it cannot be possible to change from a two of three requirement to a three of five requirement prior to making the new replicas consistent, otherwise data could be lost. By way of example, if a first quorum set is operating with only replica members A and B available out of a total configured replica set of A, B and C, replica member C is inconsistent. If new replica members D and E are then added, and the majority requirement becomes three of five, forming a new cluster with only replica members C, D and E cannot be allowed, unless at least one of C, D and E are first updated to include A and B's data.
Also, when adding a replica member and thus changing the majority requirement, the change needs to be done such that a majority can later be achieved regardless of failures. For example, if only two replicas (A, B) are available out of three replicas (A, B and C) configured, and the number of the total configured replica set is increased to four by the addition of replica member D, then three replicas will be needed for a majority. If however, after increasing the majority requirement the cluster and the replica D fail while making D consistent, then only A and B may be available, which will not achieve a quorum.
At step 2302, the update lock is acquired, and the update process (of
If the update is successful (step 2306) and the replica is now online (step 2308), then the above-described recovery process (of
If either the update failed (step 2306) or recovery failed (step 2310), the status is set to FALSE at step 2314. The update lock is then released at step 2316, and the status returned (step 2318). Note that if the update was not successful, this change might get committed to the current majority during the next recovery. If so, recovery can keep track of this special update, and reenter recovery. Further, note that failure during the writing of the epoch metadata (−1, −1) will leave the new replica in an uninitialized state, so it will never be visible to the cluster. Still further, note that failure during the update may leave the system in a state where some of replicas are aware of the new member or members, while others are not. If during subsequent recovery a replica member that is aware of a new member is operating in the quorum set, the new member information will get propagated, and the new member will be included and made consistent. If no member of a new quorum replica set is aware of the new member, an extra member will be visible but will be ignored by the cluster since it will not be part of the total configured replica set.
When removing (decommissioning) a replica member from the total configured replica set, care similar to that described above is taken to ensure that the problems above are not encountered in the event of failures, namely that data is not lost, and that a majority can still be achieved after removal.
Next, the update process (of
At step 2406, further updates are prevented, until re-enabled as described above. If the update was successful, as evaluated at step 2408, then the above-described recovery process (of
If either the update failed (step 2408) or recovery failed (step 2410), the status is set to FALSE at step 2414. The update lock is then released at step 2416, and the status returned (step 2418). Note that if the update was not successful, this change might get committed to the current majority during the next recovery. If so, recovery can keep track of this special update, and can reenter recovery.
As can be seen from the foregoing detailed description, there is provided a method and system for increasing the availability of a server cluster while reducing its cost. By requiring a server node to own a quorum of replica members in order to form or continue a cluster, and maintaining the consistency of the replica members, integrity of the cluster data is ensured.
While the invention is susceptible to various modifications and alternative constructions, certain illustrated embodiments thereof are shown in the drawings and has been described above in detail. It should be understood, however, that there is no intention to limit the invention to the specific forms disclosed, but on the contrary, the intention is to cover all modifications, alternative constructions, and equivalents falling within the spirit and scope of the invention.
|Cited Patent||Filing date||Publication date||Applicant||Title|
|US5553239 *||Nov 10, 1994||Sep 3, 1996||At&T Corporation||Management facility for server entry and application utilization in a multi-node server configuration|
|US5673384 *||Oct 6, 1995||Sep 30, 1997||Hewlett-Packard Company||Dual disk lock arbitration between equal sized partition of a cluster|
|US5727206 *||Jul 31, 1996||Mar 10, 1998||Ncr Corporation||On-line file system correction within a clustered processing system|
|US5754821 *||Mar 27, 1996||May 19, 1998||International Business Machines Corporation||Method and system for providing access to a protected partition of a memory device utilizing a passthru command|
|US5781910 *||Sep 13, 1996||Jul 14, 1998||Stratus Computer, Inc.||Preforming concurrent transactions in a replicated database environment|
|US5828876 *||Jul 31, 1996||Oct 27, 1998||Ncr Corporation||File system for a clustered processing system|
|US5828889 *||May 31, 1996||Oct 27, 1998||Sun Microsystems, Inc.||Quorum mechanism in a two-node distributed computer system|
|US5835784 *||Mar 6, 1996||Nov 10, 1998||Intel Corporation||System for booting processor from remote memory by preventing host processor from configuring an environment of processor while configuring an interface unit between processor and remote memory|
|US5893086 *||Jul 11, 1997||Apr 6, 1999||International Business Machines Corporation||Parallel file system and method with extensible hashing|
|US5909540 *||May 2, 1997||Jun 1, 1999||Mangosoft Corporation||System and method for providing highly available data storage using globally addressable memory|
|US5917998 *||Jul 26, 1996||Jun 29, 1999||International Business Machines Corporation||Method and apparatus for establishing and maintaining the status of membership sets used in mirrored read and write input/output without logging|
|US5927050 *||Nov 15, 1997||Jul 27, 1999||International Business Machines Corporation||In-box configuration method for a computer system|
|US5940838 *||Jul 11, 1997||Aug 17, 1999||International Business Machines Corporation||Parallel file system and method anticipating cache usage patterns|
|US6014669 *||Oct 21, 1997||Jan 11, 2000||Sun Microsystems, Inc.||Highly-available distributed cluster configuration database|
|US6061740 *||Jul 15, 1997||May 9, 2000||Novell, Inc.||Method and apparatus for heterogeneous network management|
|US6108781 *||Feb 23, 1999||Aug 22, 2000||Intel Corporation||Bootstrap processor selection architecture in SMP system|
|US6279032 *||Nov 3, 1997||Aug 21, 2001||Microsoft Corporation||Method and system for quorum resource arbitration in a server cluster|
|US6301462 *||Jun 25, 1999||Oct 9, 2001||Unext. Com||Online collaborative apprenticeship|
|US6314526 *||Jul 10, 1998||Nov 6, 2001||International Business Machines Corporation||Resource group quorum scheme for highly scalable and highly available cluster system management|
|US6401120 *||Mar 26, 1999||Jun 4, 2002||Microsoft Corporation||Method and system for consistent cluster operational data in a server cluster using a quorum of replicas|
|US6662219 *||Dec 15, 1999||Dec 9, 2003||Microsoft Corporation||System for determining at subgroup of nodes relative weight to represent cluster by obtaining exclusive possession of quorum resource|
|US6681251 *||Jun 28, 2000||Jan 20, 2004||International Business Machines Corporation||Workload balancing in clustered application servers|
|US6691139 *||Jan 31, 2001||Feb 10, 2004||Hewlett-Packard Development Co., Ltd.||Recreation of archives at a disaster recovery site|
|US6701453 *||Jun 11, 2001||Mar 2, 2004||Micron Technology, Inc.||System for clustering software applications|
|US6738872 *||Dec 22, 2000||May 18, 2004||International Business Machines Corporation||Clustered computer system with deadlock avoidance|
|US6807557 *||May 31, 2000||Oct 19, 2004||International Business Machines Corporation||Method, system and program products for providing clusters of a computing environment|
|US6938084 *||Jun 28, 2001||Aug 30, 2005||Microsoft Corporation||Method and system for consistent cluster operational data in a server cluster using a quorum of replicas|
|Citing Patent||Filing date||Publication date||Applicant||Title|
|US7191357 *||Dec 19, 2002||Mar 13, 2007||Panasas, Inc.||Hybrid quorum/primary-backup fault-tolerance model|
|US7529822 *||May 31, 2002||May 5, 2009||Symantec Operating Corporation||Business continuation policy for server consolidation environment|
|US7778986 *||Aug 29, 2007||Aug 17, 2010||International Business Machines Corporation||Securing transfer of ownership of a storage object from an unavailable owner node to another node|
|US7900206||Mar 31, 2004||Mar 1, 2011||Symantec Operating Corporation||Information technology process workflow for data centers|
|US7904743 *||Aug 27, 2007||Mar 8, 2011||International Business Machines Corporation||Propagation by a controller of reservation made by a host for remote storage|
|US7921169 *||Aug 4, 2008||Apr 5, 2011||Oracle International Corporation||System and method for exactly once message store communication|
|US8145838||Mar 10, 2009||Mar 27, 2012||Netapp, Inc.||Processing and distributing write logs of nodes of a cluster storage system|
|US8261125 *||Oct 21, 2011||Sep 4, 2012||Net App. Inc.||Global write-log device for managing write logs of nodes of a cluster storage system|
|US8266634||Dec 18, 2007||Sep 11, 2012||Microsoft Corporation||Resource assignment system with recovery notification|
|US8326990||Jul 15, 2005||Dec 4, 2012||Symantec Operating Corporation||Automated optimal workload balancing during failover in share-nothing database systems|
|US8327186 *||Mar 10, 2009||Dec 4, 2012||Netapp, Inc.||Takeover of a failed node of a cluster storage system on a per aggregate basis|
|US8650281 *||Feb 1, 2012||Feb 11, 2014||Symantec Corporation||Intelligent arbitration servers for network partition arbitration|
|US8707318 *||Dec 18, 2007||Apr 22, 2014||Microsoft Corporation||Partitioning system including a generic partitioning manager for partitioning resources|
|US8825601||Feb 1, 2010||Sep 2, 2014||Microsoft Corporation||Logical data backup and rollback using incremental capture in a distributed database|
|US8850007||Jun 8, 2011||Sep 30, 2014||Microsoft Corporation||Consistent cluster operational data in a server cluster using a quorum of replicas|
|US8850018||Jun 8, 2011||Sep 30, 2014||Microsoft Corporation||Consistent cluster operational data in a server cluster using a quorum of replicas|
|US8949655 *||Jan 31, 2013||Feb 3, 2015||Alcatel Lucent||Preventing extreme coresidency hazards in cloud computing|
|US20040078654 *||Dec 19, 2002||Apr 22, 2004||Holland Mark C.||Hybrid quorum/primary-backup fault-tolerance model|
|US20090100436 *||Dec 18, 2007||Apr 16, 2009||Microsoft Corporation||Partitioning system including a generic partitioning manager for partitioning resources|
|US20110178984 *||Jan 18, 2010||Jul 21, 2011||Microsoft Corporation||Replication protocol for database systems|
|US20120023209 *||Jan 26, 2012||Robert Adam Fletcher||Method and apparatus for scalable automated cluster control based on service level objectives to support applications requiring continuous availability|
|US20120042202 *||Oct 21, 2011||Feb 16, 2012||Thomas Rudolf Wenzel||Global write-log device for managing write logs of nodes of a cluster storage system|
|US20140215272 *||Jan 31, 2013||Jul 31, 2014||Alcatel-Lucent Usa Inc.||Preventing extreme coresidency hazards in cloud computing|
|U.S. Classification||714/4.1, 714/E11.073, 714/E11.128|
|International Classification||G06F11/20, G06F17/30, G06F9/50, G06F12/00, G06F15/173, G06F15/16, G06F7/00, G06F11/00|
|Cooperative Classification||G06F11/1425, G06F11/2023, G06F11/1482, G06F11/182, G06F11/181, G06F11/1662, G06F11/2035|
|European Classification||G06F11/18E, G06F11/14S1, G06F11/18M, G06F11/20P2, G06F11/20P4|
|Oct 5, 2006||AS||Assignment|
Owner name: MICROSOFT CORPORATION, WASHINGTON
Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNORS:GAMACHE, ROD;MASSA, MICHAEL T.;SHRIVASTAVA, SUNITA;AND OTHERS;REEL/FRAME:018354/0873;SIGNING DATES FROM 20020221 TO 20020226
|Jan 15, 2015||AS||Assignment|
Owner name: MICROSOFT TECHNOLOGY LICENSING, LLC, WASHINGTON
Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:MICROSOFT CORPORATION;REEL/FRAME:034766/0001
Effective date: 20141014