yumapro  24.10-3
YumaPro SDK
Loading...
Searching...
No Matches
YP-HA Control

Service layer for High Availability (YP-HA). More...

Collaboration diagram for YP-HA Control:

Data Structures

struct  yp_ha_server_t
 For each CLI-configured ha-server there will be one entry entry the active and standby both need this list; active server will reject register-request request from standby server if their server-id is not in the list. More...
 
struct  yp_ha_service_t
 YP-HA service instance. More...
 

Enumerations

enum  yp_ha_state_t {
  HA_STATE_NONE ,
  HA_STATE_DISABLED ,
  HA_STATE_ERROR ,
  HA_STATE_WAIT_ROLE ,
  HA_STATE_BE_ACTIVE ,
  HA_STATE_ACTIVE ,
  HA_STATE_BE_STANDBY ,
  HA_STATE_STANDBY ,
  HA_STATE_SHUTTING_DOWN
}
 YP-HA Shared State. More...
 

Functions

void agt_yp_ha_preinit (void)
 Pre-Initialize the YP-HA subsys handler. More...
 
status_t agt_yp_ha_init (void)
 Initialize the YP-HA subsys handler (begin phase 2 init) More...
 
status_t agt_yp_ha_init2 (void)
 Initialize the YP-HA shared state (phase 2 init, post external init). More...
 
void agt_yp_ha_cleanup (void)
 Cleanup the YP-HA Module. More...
 
status_t agt_yp_ha_add_server_cli (const xmlChar *valstr)
 Add an HA server entry from the –ha-server CLI parm. More...
 
boolean agt_yp_ha_mgmt_enabled (void)
 Check if MGMT protocols disabled because YP-HA Standby mode. More...
 
status_t agt_yp_ha_be_active (void)
 Put this server in YP-HA Active mode. More...
 
status_t agt_yp_ha_be_none (void)
 Put this server in WAIT_ROLE state. More...
 
status_t agt_yp_ha_be_standby (const xmlChar *new_server_id)
 Put this server in YP-HA Standby mode. More...
 
agt_ha_role_t agt_yp_ha_get_role (void)
 Get the YP-HA server role for this server. More...
 
const xmlChar * agt_yp_ha_get_role_state (const xmlChar **tstamp)
 Get the YP-HA server role for this server as a string. More...
 
yp_ha_service_tagt_yp_ha_get_service_cb (void)
 Get the YP-HA service control block for this server. More...
 
void agt_yp_ha_check_standby_io (void)
 Check if the YP-SA Standby mode needs to check for input. More...
 
yp_ha_server_tagt_yp_ha_find_server (const xmlChar *server_name)
 Find a server record. More...
 
void agt_yp_ha_config_update (rpc_msg_t *msg, agt_cfg_transaction_t *txcb)
 Do a config update in the active role. More...
 
status_t agt_yp_ha_nvstore (void)
 Do an <nvstore> in the active role. More...
 
boolean agt_yp_ha_sil_disabled (void)
 Check if all hooks are enabled or disabled because of the YP-HA Standby mode. More...
 
void agt_yp_ha_mod_event (const xmlChar *name, const xmlChar *revision, val_value_t *inputval, boolean is_module, boolean is_load)
 Generate a module event. More...
 
status_t agt_yp_ha_get_config_info (ncx_transaction_id_t *config_id, const xmlChar **config_stamp)
 Get the config ID and timestamp info. More...
 
status_t agt_yp_ha_get_error_info (const xmlChar **tstamp, const xmlChar **msg)
 Get the last error time and error message, if any. More...
 
const xmlChar * agt_yp_ha_get_active_server (void)
 Get the active server or in progress of connecting. More...
 
status_t agt_yp_ha_get_config_counters (uint64 *updates, uint64 *failures)
 Get the config-updates and config-failures counters. More...
 

Detailed Description

Service layer for High Availability (YP-HA).

Controls service control that will handle messages and invoke active and/or standy handlers for each message.

Enumeration Type Documentation

◆ yp_ha_state_t

YP-HA Shared State.

Enumerator
HA_STATE_NONE 

not set

HA_STATE_DISABLED 

HA disabled.

HA_STATE_ERROR 

HA error state.

HA_STATE_WAIT_ROLE 

waiting for HA role

HA_STATE_BE_ACTIVE 

in process of becoming active server

HA_STATE_ACTIVE 

active server role

HA_STATE_BE_STANDBY 

in process of becoming standby server

HA_STATE_STANDBY 

standby server role

HA_STATE_SHUTTING_DOWN 

shutting down HA service

Function Documentation

◆ agt_yp_ha_add_server_cli()

status_t agt_yp_ha_add_server_cli ( const xmlChar *  valstr)

Add an HA server entry from the –ha-server CLI parm.

Parameters
valstrCLI value string to parse and use
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_yp_ha_be_active()

status_t agt_yp_ha_be_active ( void  )

Put this server in YP-HA Active mode.

Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_yp_ha_be_none()

status_t agt_yp_ha_be_none ( void  )

Put this server in WAIT_ROLE state.

Returns
status
Here is the call graph for this function:

◆ agt_yp_ha_be_standby()

status_t agt_yp_ha_be_standby ( const xmlChar *  new_server_id)

Put this server in YP-HA Standby mode.

Parameters
new_server_idserver-id of the new active server
Returns
status NO_ERR if this server able to enter YP-HA Standby mode
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_yp_ha_check_standby_io()

void agt_yp_ha_check_standby_io ( void  )

Check if the YP-SA Standby mode needs to check for input.

Called by agt_ncxserver or main loop of some sort.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_yp_ha_cleanup()

void agt_yp_ha_cleanup ( void  )

Cleanup the YP-HA Module.

Called by the server during shutdown.

Here is the call graph for this function:

◆ agt_yp_ha_config_update()

void agt_yp_ha_config_update ( rpc_msg_t msg,
agt_cfg_transaction_t txcb 
)

Do a config update in the active role.

Parameters
msgRPC msg in progress
txcbtransaction control block
Here is the call graph for this function:

◆ agt_yp_ha_find_server()

yp_ha_server_t * agt_yp_ha_find_server ( const xmlChar *  server_name)

Find a server record.

** NOT A USER API FUNCTION **

Find a ha_server record

Parameters
server_nameserver name string
Returns
pointer to found record
Here is the call graph for this function:

◆ agt_yp_ha_get_active_server()

const xmlChar * agt_yp_ha_get_active_server ( void  )

Get the active server or in progress of connecting.

Returns
active-server or NULL if not available or not applicable
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_yp_ha_get_config_counters()

status_t agt_yp_ha_get_config_counters ( uint64 *  updates,
uint64 *  failures 
)

Get the config-updates and config-failures counters.

Parameters
[out]updatesaddress of return config-updates counter
*updates return config-updates counter
[out]failuresaddress of return config-failures counter
*failures return config-failures counter
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_yp_ha_get_config_info()

status_t agt_yp_ha_get_config_info ( ncx_transaction_id_t config_id,
const xmlChar **  config_stamp 
)

Get the config ID and timestamp info.

Parameters
[out]config_idaddress of return config-id
*config_id return config-id
[out]config_stampaddress of return config-stamp
*config_stamp return config-stamp
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_yp_ha_get_error_info()

status_t agt_yp_ha_get_error_info ( const xmlChar **  tstamp,
const xmlChar **  msg 
)

Get the last error time and error message, if any.

Parameters
[out]tstampaddress of return last-error-time
*tstamp return last-error-time
[out]msgaddress of return last-error-msg *msg return last-error-msg
Returns
status; NO_ERR if there is a last error to report
ERR_NCX_SKIPPED if there have been no HA state errors
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_yp_ha_get_role()

agt_ha_role_t agt_yp_ha_get_role ( void  )

Get the YP-HA server role for this server.

Returns
server role enum
Here is the caller graph for this function:

◆ agt_yp_ha_get_role_state()

const xmlChar * agt_yp_ha_get_role_state ( const xmlChar **  tstamp)

Get the YP-HA server role for this server as a string.

Parameters
[out]tstampaddress of return pointer to ha-role-state-time
*tstamp return pointer to ha-role-state-time
Returns
server role state string
Here is the caller graph for this function:

◆ agt_yp_ha_get_service_cb()

yp_ha_service_t * agt_yp_ha_get_service_cb ( void  )

Get the YP-HA service control block for this server.

Returns
YP-HA service control block

◆ agt_yp_ha_init()

status_t agt_yp_ha_init ( void  )

Initialize the YP-HA subsys handler (begin phase 2 init)

Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_yp_ha_init2()

status_t agt_yp_ha_init2 ( void  )

Initialize the YP-HA shared state (phase 2 init, post external init).

The YP-HA role is expected to be set

Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_yp_ha_mgmt_enabled()

boolean agt_yp_ha_mgmt_enabled ( void  )

Check if MGMT protocols disabled because YP-HA Standby mode.

Returns
TRUE if management sessions are allowed now
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_yp_ha_mod_event()

void agt_yp_ha_mod_event ( const xmlChar *  name,
const xmlChar *  revision,
val_value_t inputval,
boolean  is_module,
boolean  is_load 
)

Generate a module event.

Notify the standby of a new module loaded into the server

Parameters
namemodule or bundle name
revisionmodule or bundle revision version
inputvalparent of any <deviation> parameters
is_moduleTRUE for module; FALSE for bundle
is_loadTRUE for laod; FALSE for unload
Here is the call graph for this function:

◆ agt_yp_ha_nvstore()

status_t agt_yp_ha_nvstore ( void  )

Do an <nvstore> in the active role.

Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ agt_yp_ha_preinit()

void agt_yp_ha_preinit ( void  )

Pre-Initialize the YP-HA subsys handler.

The ha_serverQ needs to be initialized. This is expected to be set with server records by agt_cli by processing ha-server parameters.

Here is the call graph for this function:

◆ agt_yp_ha_sil_disabled()

boolean agt_yp_ha_sil_disabled ( void  )

Check if all hooks are enabled or disabled because of the YP-HA Standby mode.

Returns
TRUE if SIL disabled; FALSE if SIL enabled
Here is the call graph for this function:
Here is the caller graph for this function: