Creating a complete coordination module  Using concurrent coordination modules

Chapter 2: Using Coordination Modules

Enabling Sybase Failover

To support Sybase Failover, add code to the existing CMs. See the cml.c sample in $OPENSWITCH/sample/ on UNIX and %OPENSWITCH%\sample\ on Windows, under the cm_srvreq_hdl function under the case for COORD_R_HAFAILOVER. Add this code to the CM:

case COORD_R_HAFAILOVER:
      if (cm_set_srv(cm, req->spidm req->cur_server) !=CS_SUCCEED
      {
              fprintf(stderr, “cm1: Unable for spid ‘%d’ to stay put on the
                     current server\n”, (int) req->spid);
       }
        break;

This code segment returns the server name. In a multicluster environment, the CM is notified of a failover event only when the entire primary Adaptive Server Enterprise cluster fails. The CM is not notified when the primary node of the Adaptive Server cluster fails, as connections are automatically redirected to the secondary node without consulting the CM.





Copyright © 2005. Sybase Inc. All rights reserved. Using concurrent coordination modules

View this book as PDF