yumapro
24.10-3
YumaPro SDK
|
Service layer for High Availability (YP-HA). More...
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_t * | agt_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_t * | agt_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... | |
Service layer for High Availability (YP-HA).
Controls service control that will handle messages and invoke active and/or standy handlers for each message.
enum yp_ha_state_t |
YP-HA Shared State.
status_t agt_yp_ha_add_server_cli | ( | const xmlChar * | valstr | ) |
Add an HA server entry from the –ha-server CLI parm.
valstr | CLI value string to parse and use |
status_t agt_yp_ha_be_active | ( | void | ) |
Put this server in YP-HA Active mode.
status_t agt_yp_ha_be_none | ( | void | ) |
Put this server in WAIT_ROLE state.
status_t agt_yp_ha_be_standby | ( | const xmlChar * | new_server_id | ) |
Put this server in YP-HA Standby mode.
new_server_id | server-id of the new active server |
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.
void agt_yp_ha_cleanup | ( | void | ) |
Cleanup the YP-HA Module.
Called by the server during shutdown.
void agt_yp_ha_config_update | ( | rpc_msg_t * | msg, |
agt_cfg_transaction_t * | txcb | ||
) |
Do a config update in the active role.
msg | RPC msg in progress |
txcb | transaction control block |
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
server_name | server name string |
const xmlChar * agt_yp_ha_get_active_server | ( | void | ) |
Get the active server or in progress of connecting.
status_t agt_yp_ha_get_config_counters | ( | uint64 * | updates, |
uint64 * | failures | ||
) |
Get the config-updates and config-failures counters.
[out] | updates | address of return config-updates counter *updates return config-updates counter |
[out] | failures | address of return config-failures counter *failures return config-failures counter |
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.
[out] | config_id | address of return config-id *config_id return config-id |
[out] | config_stamp | address of return config-stamp *config_stamp return config-stamp |
status_t agt_yp_ha_get_error_info | ( | const xmlChar ** | tstamp, |
const xmlChar ** | msg | ||
) |
Get the last error time and error message, if any.
[out] | tstamp | address of return last-error-time *tstamp return last-error-time |
[out] | msg | address of return last-error-msg *msg return last-error-msg |
agt_ha_role_t agt_yp_ha_get_role | ( | void | ) |
Get the YP-HA server role for this server.
const xmlChar * agt_yp_ha_get_role_state | ( | const xmlChar ** | tstamp | ) |
Get the YP-HA server role for this server as a string.
[out] | tstamp | address of return pointer to ha-role-state-time *tstamp return pointer to ha-role-state-time |
yp_ha_service_t * agt_yp_ha_get_service_cb | ( | void | ) |
Get the YP-HA service control block for this server.
status_t agt_yp_ha_init | ( | void | ) |
Initialize the YP-HA subsys handler (begin phase 2 init)
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
boolean agt_yp_ha_mgmt_enabled | ( | void | ) |
Check if MGMT protocols disabled because YP-HA Standby mode.
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
name | module or bundle name |
revision | module or bundle revision version |
inputval | parent of any <deviation> parameters |
is_module | TRUE for module; FALSE for bundle |
is_load | TRUE for laod; FALSE for unload |
status_t agt_yp_ha_nvstore | ( | void | ) |
Do an <nvstore> in the active role.
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.
boolean agt_yp_ha_sil_disabled | ( | void | ) |
Check if all hooks are enabled or disabled because of the YP-HA Standby mode.