Title of Invention: Method and apparatus for providing a highly available distributed event notification mechanism
Abstract: 
One embodiment of the present invention provides a system that supports event notification within a distributed computing system. Upon receiving an event that was generated at a node in the distributed computing system, the system performs a lookup in a database to determine a list of clients that are registered to be notified of the event. The system then sends a notification of the event to clients in the list. In a variation on this embodiment, the event notification is performed by an event forwarding mechanism that is highly available. In this way, if the event forwarding mechanism fails, a new instance of the event forwarding mechanism is automatically started, possibly on a different node within the distributed computing system. 

Summary of Invention: 

BACKGROUND 
&lsqb;0001&rsqb; 1. Field of the Invention 
&lsqb;0002&rsqb; The present invention relates to the design of distributed computing systems. More specifically, the present invention relates to a method and an apparatus for providing a highly available notification mechanism within a distributed computing system to facilitate the development of distributed applications. 
&lsqb;0003&rsqb; 2. Related Art 
&lsqb;0004&rsqb; Distributed computing systems presently make it possible to develop distributed applications that can harness the computational power of multiple computing nodes in performing a computational task. This can greatly increase the speed with which the computational task can be performed. 
&lsqb;0005&rsqb; However, it is often hard to coordinate computational activities between application components running on different computing nodes within the distributed computing system. 
&lsqb;0006&rsqb; In order to operate properly, distributed applications must somehow keep track of the state of application components in order to coordinate interactions between the application components. This can involve periodically exchanging “heartbeat” messages or other information between application components to keep track of which application components are functioning properly. 
&lsqb;0007&rsqb; Some distributed operating systems presently keep track of this type of information for purposes of coordinating interactions between operating system components running on different computing nodes. However, these distributed operating systems only use this information in performing specific operating system functions. They do not make this information available to distributed applications or other clients. 
&lsqb;0008&rsqb; Hence, in many situations, a distributed application has to keep track of this information on its own. Note that the additional work involved in keeping track of this information is largely wasted because the distributed operating system already keeps track of the information. Moreover, the task of keeping track of this information generates additional network traffic, which can impede communications between nodes in the distributed computing system. 
&lsqb;0009&rsqb; Hence, what is needed is a method and an apparatus that enables a distributed application to be notified of events that occur on different computing nodes within a distributed computing system without requiring the distributed application to perform the event monitoring operations. 


SUMMARY 
&lsqb;0010&rsqb; One embodiment of the present invention provides a system that supports event notification within a distributed computing system. Upon receiving an event that was generated at a node in the distributed computing system, the system performs a lookup in a database to determine a list of clients that are registered to be notified of the event. The system then sends a notification of the event to clients in the list. 
&lsqb;0011&rsqb; In a variation on this embodiment, the event notification is performed by an event forwarding mechanism that is highly available. In this way, if the event forwarding mechanism fails, a new instance of the event forwarding mechanism is automatically started, possibly on a different node within the distributed computing system. 
&lsqb;0012&rsqb; In a variation on this embodiment, the list of clients can include applications or application components running within the distributed computing system, as well as applications or application components running outside of the distributed computing system. 
&lsqb;0013&rsqb; In a variation on this embodiment, the events can include cluster membership events, such as a node joining the cluster or a node leaving the cluster. The events can also include events related to applications, such as a state change for an application (or an application component), or a state change for a group of related applications. Note that a state change for an application (or application component) can include: the application entering an on-line state; the application entering an off-line state; the application entering a degraded state, wherein the application is not functioning efficiently; and the application entering a faulted state, wherein the application is not functioning. The events can also include state changes related to monitoring applications or other system components, such as “monitoring started” and “monitoring stopped.”
&lsqb;0014&rsqb; In a variation on this embodiment, the system receives a registration request from a client, wherein the registration request includes a callback address for the client and a list of events that the client wants to be notified of. Upon receiving this registration request, the system records the callback address of the client and the list of events in the database, so that the client can be notified if events in the list occur. 
&lsqb;0015&rsqb; In a variation on this embodiment, the system additionally distributes the event through an inter-node event forwarding mechanism to other nodes in the distributed computing system. 
&lsqb;0016&rsqb; In a variation on this embodiment, generating the event involves posting the event through an application programming interface (API) provided by the distributed computing system. 
&lsqb;0017&rsqb; In a variation on this embodiment, the event is received across a network that couples together nodes in the distributed computing system. 
&lsqb;0018&rsqb; In a variation on this embodiment, the database is a fault-tolerant distributed database.


Detailed Description: 

DETAILED DESCRIPTION 
&lsqb;0024&rsqb; The following description is presented to enable any person skilled in the art to make and use the invention, and is provided in the context of a particular application and its requirements. Various modifications to the disclosed embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other embodiments and applications without departing from the spirit and scope of the present invention. Thus, the present invention is not intended to be limited to the embodiments shown, but is to be accorded the widest scope consistent with the principles and features disclosed herein. 
&lsqb;0025&rsqb; The data structures and code described in this detailed description are typically stored on a computer readable storage medium, which may be any device or medium that can store code and/or data for use by a computer system. This includes, but is not limited to, magnetic and optical storage devices such as disk drives, magnetic tape, CDs (compact discs) and DVDs (digital versatile discs or digital video discs), and computer instruction signals embodied in a transmission medium (with or without a carrier wave upon which the signals are modulated). For example, the transmission medium may include a communications network, such as the Internet. 
&lsqb;0026&rsqb; Distributed Computing System 
&lsqb;0027&rsqb; FIG. 1 illustrates a distributed computing system 100 in accordance with an embodiment of the present invention. As is illustrated in FIG. 1, distributed computing system 100 includes a number of clients 121-123 coupled to a highly available server 101 through a network 120. Network 120 can generally include any type of wire or wireless communication channel capable of coupling together computing nodes. This includes, but is not limited to, a local area network, a wide area network, or a combination of networks. In one embodiment of the present invention, network 120 includes the Internet. Clients 121-122 can generally include any node on a network including computational capability and including a mechanism for communicating across the network. 
&lsqb;0028&rsqb; Highly available server 101 can generally include any collection of computational nodes including a mechanism for servicing requests from a client for computational and/or data storage resources. Moreover, highly available server 101 is configured so that it can continue to operate even if a node within highly available server 101 fails. This can be accomplished using a failover model, wherein if an instance of an application fails, a new instance is automatically started, possibly on a different node within the distributed computing system. 
&lsqb;0029&rsqb; In the embodiment illustrated in FIG, 1, highly available server 101 includes a number of computing nodes 106-109 coupled together through a cluster network 102. Computing nodes 106-109 can generally include any type of computer system, including, but not limited to, a computer system based on a microprocessor, a mainframe computer, a digital signal processor, a portable computing device, a personal organizer, a device controller, and a computational engine within an appliance. Cluster network 102 can generally include any type of wire or wireless communication channel capable of coupling together computing nodes. This includes, but is not limited to, a local area network, a wide area network, or a combination of networks. 
&lsqb;0030&rsqb; Computing nodes 106-109 host a number of application components 110-117, which communicate with each other to service requests from clients 121-123. Note that application components can include any type of application (or portion of an application) that can execute on computing nodes 106-109. During operation, resources within computing nodes 106-109 provide a distributed event notification mechanism that can be used by application components 110-117 to coordinate interactions between application components 110-117. This distributed event notification mechanism is described in more detail below with reference to FIGS. 2-5. 
&lsqb;0031&rsqb; Note that although the present invention is described in the context of a highly available server 101, including multiple computing nodes 106-109, the present invention is not meant to be limited to such a system. In general, the present invention can be applied to any type of computing system with multiple computing nodes and is not meant to be limited to the specific highly available server 101 illustrated in FIG. 1. 
&lsqb;0032&rsqb; Computing Node 
&lsqb;0033&rsqb; FIG. 2 illustrates a computing node 106 in accordance with an embodiment of the present invention. Computing node 106 contains a node operating system (OS) 206, which can generally include any type of operating system for a computer system. Cluster operating system (OS) 204 runs on top of node OS 206, and coordinates interactions between computing nodes 106-109. 
&lsqb;0034&rsqb; In one embodiment of the present invention, cluster OS 204 supports failover operations to provide high availability for applications running on computing nodes 106-109. In this embodiment, cluster OS 204 ensures that state information for an application is propagated to persistent storage. In this way, if the application fails, a new instance of the application can be automatically started by retrieving the state information from persistent storage. Note that the new instance of the application can be started on either the same computing node or a different computing node. Moreover, the failover operation generally takes place without significantly interrupting ongoing operations associated with the application. 
&lsqb;0035&rsqb; Cluster OS provides an event application programming interface (API) that can be used by application components 110-111 to receive event notifications. More specifically, event API 202 enables application components: to register to be notified of events; to post events; and to and to receive notifications for events as is described below with reference to FIGS. 3-5. 
&lsqb;0036&rsqb; Event Forwarding Components 
&lsqb;0037&rsqb; FIG. 3 illustrates components involved in the event forwarding process in accordance with an embodiment of the present invention. As is illustrated in FIG. 3, computing nodes 106-109 in the highly available server 101 contain inter-node event forwarders (IEFs) 302-305, respectively. Each of these IEFs 302-305 receives events generated locally on computing nodes 106-109 and automatically communicates the events to all of the other IEFs as is illustrated by the dashed lines in FIG. 3. 
&lsqb;0038&rsqb; Computing node 107 also contains a highly available event forwarder (HA-EF) 306, which is responsible for forwarding specific events to clients that desire to be notified of the specific events. HA-EF 306 does this by receiving an event from IEF 303 on computing node 107 and then looking up the event in a cluster database 307 to determine which clients desire to be notified of the event. HA-EF 306 then forwards the event to any clients, such as client 308, that desire to be notified of the event. 
&lsqb;0039&rsqb; Note that client 308 can be located within computing nodes 106-109. For example, an application component 110 on computing node 106 can be notified of a change in state of an application component 115 on computing node 107. Client 308 can alternatively be located at a remote client. For example, an application on client 121 can be notified of state changes to a group of related application components 110, 115 and 112 running on computing nodes, 106, 107 and 109, respectively. 
&lsqb;0040&rsqb; Note that HA-EF 306 is “highly available.” This means that if HA-EF 306 fails, a new instance of HA-EF 306 is automatically restarted, possibly on a different computing node. Note that HA-EF 306 can be restarted using client registration information stored within cluster database 307. In one embodiment of the present invention, when a new instance of HA-EF 306 is restarted, the new instance asks for a snapshot of the event information from all of the other nodes. 
&lsqb;0041&rsqb; Also note that cluster database 307 is a fault-tolerant distributed database that is stored in non-volatile storage associated with computing nodes 106-109. In this way, the event registration information will not be lost if one of the computing nodes 106-109 fails. 
&lsqb;0042&rsqb; Registration Process 
&lsqb;0043&rsqb; FIG. 4 is a flow chart illustrating the registration process for event notification in accordance with an embodiment of the present invention. The process starts when a client, such as client 308 in FIG. 3, sends a registration request to HA-EF 306 (step 402). This can involve sending the registration request to an IP address associated with HA-EF 306. This registration request includes a callback address for client 308. For example, the callback address can include an Internet Protocol (IP) address and associated port number for client 308. The registration request also includes a list of events that the client is interested in being notified of. 
&lsqb;0044&rsqb; Events in the list can include any type of events that can be detected within computing nodes 106-109. For example, the events can include cluster membership events, such as a node joining the cluster or a node leaving the cluster. The events can also involve applications. For example, the events can include: a state change for an application (or an application component) running within the distributed computing system, or a state change for a group of related applications running within the distributed computing system. 
&lsqb;0045&rsqb; Note that a state change for an application (or application component) can include: the application entering an on-line state; the application entering an off-line state; the application entering a degraded state, wherein the application is not functioning efficiently; and the application entering a faulted state, wherein the application is not functioning. The events can also include state changes related to monitoring applications or other system components, such as “monitoring started” and “monitoring stopped.” Also note that the present invention is not limited to the types of events listed above. In general, any other type of event associated with a computing node, such as timer expiring or an interrupt occurring, can give rise to a notification. 
&lsqb;0046&rsqb; Upon receiving the registration request, HA-EF 306 records the callback address of client 308 and the list of events in cluster database 307 (step 404). HA-EF 306 then responds “success” to client 308 and the registration process is complete (step 406). After registering for an event, client 308 can simply disconnect and does not need to maintain any connections to the cluster. When an event of interest subsequently arrives, HA-EF 306 initiates a connection to client 308 to deliver the event. Thus, client 308 does not need to do any maintenance, except for maintaining an open listening socket. 
&lsqb;0047&rsqb; Event Forwarding Process 
&lsqb;0048&rsqb; FIG. 5 is a flow chart illustrating the process of forwarding an event in accordance with an embodiment of the present invention. The process starts when an event is generated at one of computing nodes 106-109, for example computing node 106 (step 502). This event generation may involve an application component (or operating system component) posting the event through an event API on one of the computing nodes. In one embodiment of the present invention, events can be generated through the SOLARIS™ sysevent mechanism. (SOLARIS is a registered trademark of SUN Microsystems, Inc. of Santa Clara, Calif.) 
&lsqb;0049&rsqb; Next, a local IEF 302 on computing node 106 receives the event and forwards the event to the other IEFs 303-305 located on the other computing nodes 107-109 (step 504). In one embodiment of the present invention, the event is added to the sysevent queue in the delivered nodes, which allows the event to be treated as if it was generated locally (except that it is not again forwarded to other nodes). 
&lsqb;0050&rsqb; Next, HA-EF 306 receives the event and looks up an associated list of clients in cluster database 307. This lookup can involve any type of lookup structure that can efficiently lookup a set of interested clients for a specific event. HA-EF 306 then forwards the event to all of the clients in the list (step 506). This completes the event notification process. 
&lsqb;0051&rsqb; Note that the event notification process facilitates the development of distributed applications because it allows application components running on different computing nodes to be informed of state changes in related application components without having to exchange heartbeat messages or other status information between the application components. 
&lsqb;0052&rsqb; Also note that in many applications, it is important to guarantee a total ordering of events. Hence if events are missed, it is advantageous for subsequent events to indicate the total state of the system, so that clients are not left with an incorrect view of the event ordering. 
&lsqb;0053&rsqb; The foregoing descriptions of embodiments of the present invention have been presented for purposes of illustration and description only. They are not intended to be exhaustive or to limit the present invention to the forms disclosed. Accordingly, many modifications and variations will be apparent to practitioners skilled in the art. Additionally, the above disclosure is not intended to limit the present invention. The scope of the present invention is defined by the appended claims. 



{'app_number': '10285176', 'application_number': None, 'doc_number': '20040088401', 'publication_number': None, 'source_file': './application/2004/pa040506.xml', 'source_data': 'USPTO-Application'}