Previous Topic: Switching Over for High Availability Scenarios: switchover()Next Topic: VSS Snapshot Management APIs


Enabling Heartbeats in High Availability Scenarios: start_is_alive()

Is-alive is an electronic signal that replica servers send to master servers to identify the status of the node. While high availability scenarios run, the replica server periodically sends an electronic signal (ping) to the master server. By default, the frequency of the ping is 30 seconds. You can trigger a switchover event when the replica server cannot ping the master after a predetermined period of time elapses (the default is 300 seconds).

The start_is_alive API function lets you resume the is-alive check.

Arguments

The start_is_alive API function includes the arguments described in the following table:

Name

Type

Description

session_id

uint

The session ID that was returned by calling the create_session API.

scenario_id

uint

The scenario ID for which you want to start the is-alive check.

execute_sync

bool

Regulates whether to call this API synchronously or asynchronously.

err_message

out string

Contains the reason for failure when this API fails.

Return Values

The return type is Boolean. When the return value is true, the API completed successfully. When the return value is false, the API did not complete successfully. If the return value is false, review the message to determine the reason the API failed.

Example

public bool start_is_alive_example()
        {
            try
            {
                uint scenario_id = _ha_scenario_id;
                string err_messages = "";
                bool execute_sync = true;
                return get_mng().start_is_alive(session_id, scenario_id, execute_sync, out err_messages);
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message);
            }
            return false;
        }