Appendix C: Open Client Functionality in a Failover Configuration  Glossary

Appendix C: Open Client Functionality in a Failover Configuration

CTLIB application changes

NoteAn application installed in a cluster must be able to run on both the primary and secondary companions. That is, if you install an application that requires a parallel configuration, you must also configure the secondary companion for parallel processing so it can run the application during fail over.

You must modify all applications that are written with CTLIB API calls before they can work with the Sybase Failover. Use:

  1. Set the CS_HAFAILOVER property using the ct_config and ct_con_props CTLIB API calls. You can set this property at either the context or the connection level. Using the following syntax:

    ct_config(context, action, CS_HAFAILOVER, buf, buflen,    outlen)
    ct_con_props(connection, action, CS_HAFAILOVER, buf,    buflen, outlen)
    
  2. Modify the interfaces file so clients fail over to the secondary companion.

    The interfaces file includes a line labeled hafailover that enables clients to reconnect to the secondary companion when the primary companion crashes, or when you issue a shutdown with nowait, triggering a failover.

    See the “Adding entries for both Adaptive Servers to the interfaces file” section in the chapter for your platform for information about adding this line.

  3. Write application failover messages according to these parameters:

  4. Add return codes.

    When a successful failover occurs, the client issues a return value named CS_RET_HAFAILOVER, which is specific to the following CTLIB API calls:

    ret = ct_results(cmd, result_type)
    
    ret = ct_send(cmd)
    

    CS_RET_HAFAILOVER is returned from the API call during a synchronous connection. In an asynchronous connection, these API s issue CS_PENDING, and the callback function returns CS_RET_HAFAILOVER. Depending on the return code, the customer can perform the required processing, such as sending the next command to be executed.

    1. Rebuild your applications, linking them with the libraries included with the failover software.

    NoteYou cannot connect clients with the failover property until you issue sp_companion resume. If you do try to reconnect them after issuing sp_companion prepare_failback, the client stops responding until you issue sp_companion resume.





Copyright © 2005. Sybase Inc. All rights reserved. Glossary

View this book as PDF