Sun Cluster 2.2 API Developer's Guide

Coordinating Dependencies Between Data Services

Sometimes, one client-server data service makes requests upon another client-server data service while fulfilling a request for a client. Informally, a data service A depends on a data service B if, for A to provide its service, B must be providing its service.

Sun Cluster enables having dependent data services by providing the -d switch to the hareg(1M) program. The dependencies affect the order in which Sun Cluster starts and stops data services. See the hareg(1M) man page for details.

Determine whether there are any data service dependencies and whether to supply the appropriate -d switches to hareg(1M). Sun Cluster does not check the completeness of the supplied -d switches.

Decide whether to use the -d switches or to omit them and poll for the availability of the other data service(s) in your HA data service's own code. In some cases, polling is required anyway, because the other data service's start method might be asynchronous--it might start the data service but not wait for the data service to actually be available to clients before returning from the start or start_net method. Database services typically exhibit this behavior because database recovery time is often lengthy.

Dependent Data Service Using Another Back-End Data Service

Some data services store no data directly themselves, but instead depend upon another back-end data service to store all their data. Such a data service translates all read and update requests into calls on the back-end data service. For example, consider a hypothetical client-server appointment calendar service that keeps all of its data in an SQL database such as Oracle. The appointment calendar service has its own client-server network protocol. For example, it might have defined its protocol using an RPC specification language, such as ONC(TM) RPC.

In the Sun Cluster environment, you can use Sun Cluster HA for Oracle to make the back-end Oracle database highly available. Then, you can write simple methods for starting and stopping the appointment calendar daemon. You can register the appointment calendar data service with Sun Cluster as one that depends upon another Sun Cluster data service, Sun Cluster HA for Oracle. Specify this dependency using the -d option to hareg(1M).

The start method for Oracle might initiate only database recovery and might not wait for the recovery to complete. Therefore, our calendar data service daemon, once it has been started, must poll waiting for the Oracle database to become available.