CUBRID Engine
latest
|
#include "heartbeat.h"
#include "log_lsa.hpp"
#include "master_util.h"
#include "porting.h"
#include "system_parameter.h"
Go to the source code of this file.
Classes | |
struct | hb_list |
struct | hb_node_entry |
struct | hb_ping_host_entry |
struct | hb_ui_node_entry |
struct | hb_cluster |
struct | HB_PROC_ENTRY |
struct | hb_resource |
struct | hb_cluster_job_arg |
struct | hb_resource_job_arg |
union | hb_job_arg |
struct | hb_job_entry |
struct | hb_job |
Typedefs | |
typedef struct hb_list | HB_LIST |
typedef struct hb_node_entry | HB_NODE_ENTRY |
typedef struct hb_ping_host_entry | HB_PING_HOST_ENTRY |
typedef struct hb_ui_node_entry | HB_UI_NODE_ENTRY |
typedef struct hb_cluster | HB_CLUSTER |
typedef struct hb_resource | HB_RESOURCE |
typedef struct hb_cluster_job_arg | HB_CLUSTER_JOB_ARG |
typedef struct hb_resource_job_arg | HB_RESOURCE_JOB_ARG |
typedef union hb_job_arg | HB_JOB_ARG |
typedef void(* | HB_JOB_FUNC) (HB_JOB_ARG *) |
typedef struct hb_job_entry | HB_JOB_ENTRY |
typedef struct hb_job | HB_JOB |
Variables | |
HB_CLUSTER * | hb_Cluster |
HB_RESOURCE * | hb_Resource |
HB_JOB * | cluster_Jobs |
HB_JOB * | resource_Jobs |
bool | hb_Deactivate_immediately |
#define HB_BUFFER_SZ (4096) |
Definition at line 127 of file master_heartbeat.h.
Referenced by hb_cluster_send_heartbeat_internal(), hb_register_new_process(), and hb_thread_cluster_reader().
#define HB_CMD_ACTIVATE_STR "activate" |
Definition at line 139 of file master_heartbeat.h.
Referenced by hb_activate_heartbeat().
#define HB_CMD_DEACTIVATE_STR "deactivate" |
Definition at line 140 of file master_heartbeat.h.
Referenced by css_process_deact_stop_all(), css_process_deactivate_heartbeat(), hb_deactivate_heartbeat(), and hb_prepare_deactivate_heartbeat().
#define HB_CMD_DEREGISTER_STR "deregister" |
Definition at line 141 of file master_heartbeat.h.
Referenced by hb_deregister_by_args(), hb_deregister_by_pid(), and hb_deregister_process().
#define HB_CMD_RELOAD_STR "reload" |
Definition at line 142 of file master_heartbeat.h.
Referenced by hb_reconfig_heartbeat().
#define HB_CMD_UTIL_START_STR "util process start" |
Definition at line 143 of file master_heartbeat.h.
Referenced by hb_start_util_process().
#define HB_GET_ELAPSED_TIME | ( | end_time, | |
start_time | |||
) |
Definition at line 176 of file master_heartbeat.h.
Referenced by hb_cleanup_conn_and_start_process(), hb_cleanup_ui_nodes(), hb_cluster_calc_score(), hb_cluster_is_received_heartbeat_from_all(), hb_get_node_info_string(), and hb_resource_job_proc_start().
#define HB_IPV4_STR_LEN (16) |
Definition at line 187 of file master_heartbeat.h.
Referenced by hb_get_node_info_string().
#define HB_IS_INITIALIZED_TIME | ( | arg_time | ) | ((arg_time.tv_sec == 0 && arg_time.tv_usec == 0) ? 1 : 0) |
Definition at line 180 of file master_heartbeat.h.
Referenced by hb_cluster_calc_score().
#define HB_MAX_CHANGEMODE_DIFF_TO_KILL (24) |
Definition at line 133 of file master_heartbeat.h.
Referenced by hb_resource_send_changemode().
#define HB_MAX_CHANGEMODE_DIFF_TO_TERM (12) |
Definition at line 132 of file master_heartbeat.h.
Referenced by hb_resource_send_changemode().
#define HB_MAX_NUM_NODES (8) |
Definition at line 128 of file master_heartbeat.h.
#define HB_MAX_NUM_RESOURCE_PROC (16) |
Definition at line 129 of file master_heartbeat.h.
#define HB_MAX_PING_CHECK (3) |
Definition at line 130 of file master_heartbeat.h.
Referenced by hb_cluster_job_check_ping().
#define HB_MAX_WAIT_FOR_NEW_MASTER (60) |
Definition at line 131 of file master_heartbeat.h.
Referenced by hb_cluster_job_demote().
#define HB_NODE_SCORE_MASTER 0x8000 |
Definition at line 122 of file master_heartbeat.h.
Referenced by hb_cluster_calc_score().
#define HB_NODE_SCORE_SLAVE 0x0000 |
Definition at line 124 of file master_heartbeat.h.
Referenced by hb_cluster_calc_score().
#define HB_NODE_SCORE_TO_BE_MASTER 0xF000 |
Definition at line 123 of file master_heartbeat.h.
Referenced by hb_cluster_calc_score().
#define HB_NODE_SCORE_UNKNOWN 0x7FFF |
Definition at line 125 of file master_heartbeat.h.
Referenced by hb_cluster_calc_score().
#define HB_PING_FAILURE_STR "FAILURE" |
Definition at line 58 of file master_heartbeat.h.
Referenced by hb_ping_result_string().
#define HB_PING_STR_SIZE (7) |
Definition at line 59 of file master_heartbeat.h.
Referenced by hb_get_ping_host_info_string().
#define HB_PING_SUCCESS_STR "SUCCESS" |
Definition at line 55 of file master_heartbeat.h.
Referenced by hb_ping_result_string().
#define HB_PING_SYS_ERR_STR "ERROR" |
Definition at line 57 of file master_heartbeat.h.
Referenced by hb_ping_result_string().
#define HB_PING_UNKNOWN_STR "UNKNOWN" |
Definition at line 54 of file master_heartbeat.h.
Referenced by hb_ping_result_string().
#define HB_PING_USELESS_HOST_STR "SKIPPED" |
Definition at line 56 of file master_heartbeat.h.
Referenced by hb_ping_result_string().
#define HB_PROC_RECOVERY_DELAY_TIME (30* 1000) /* milli-second */ |
Definition at line 183 of file master_heartbeat.h.
Referenced by hb_resource_job_proc_start().
#define HB_PSTATE_DEAD_STR "dead" |
Definition at line 108 of file master_heartbeat.h.
Referenced by hb_process_state_string().
#define HB_PSTATE_DEREGISTERED_STR "deregistered" |
Definition at line 109 of file master_heartbeat.h.
Referenced by hb_process_state_string().
#define HB_PSTATE_NOT_REGISTERED_STR "not_registered" |
Definition at line 111 of file master_heartbeat.h.
Referenced by hb_process_state_string().
#define HB_PSTATE_REGISTERED_AND_ACTIVE_STR "registered_and_active" |
Definition at line 115 of file master_heartbeat.h.
Referenced by hb_process_state_string().
#define HB_PSTATE_REGISTERED_AND_STANDBY_STR "registered_and_standby" |
Definition at line 113 of file master_heartbeat.h.
Referenced by hb_process_state_string().
#define HB_PSTATE_REGISTERED_AND_TO_BE_ACTIVE_STR "registered_and_to_be_active" |
Definition at line 116 of file master_heartbeat.h.
Referenced by hb_process_state_string().
#define HB_PSTATE_REGISTERED_AND_TO_BE_STANDBY_STR "registered_and_to_be_standby" |
Definition at line 114 of file master_heartbeat.h.
Referenced by hb_process_state_string().
#define HB_PSTATE_REGISTERED_STR "registered" |
Definition at line 112 of file master_heartbeat.h.
Referenced by hb_process_state_string().
#define HB_PSTATE_STARTED_STR "started" |
Definition at line 110 of file master_heartbeat.h.
Referenced by hb_process_state_string().
#define HB_PSTATE_STR_SZ (32) |
Definition at line 117 of file master_heartbeat.h.
Referenced by hb_get_process_info_string().
#define HB_PSTATE_UNKNOWN_STR "unknown" |
Definition at line 107 of file master_heartbeat.h.
Referenced by hb_process_state_string().
#define HB_REPLICA_PRIORITY 0x7FFF |
Definition at line 119 of file master_heartbeat.h.
Referenced by hb_cluster_load_group_and_node_list().
#define HB_RESULT_FAILURE_STR "Failure" |
Definition at line 137 of file master_heartbeat.h.
Referenced by css_process_deact_stop_all(), css_process_deactivate_heartbeat(), hb_activate_heartbeat(), hb_deactivate_heartbeat(), hb_deregister_by_args(), hb_deregister_by_pid(), hb_deregister_process(), hb_reconfig_heartbeat(), hb_register_new_process(), and hb_start_util_process().
#define HB_RESULT_SUCCESS_STR "Success" |
Definition at line 136 of file master_heartbeat.h.
Referenced by hb_activate_heartbeat(), hb_deactivate_heartbeat(), hb_deregister_by_args(), hb_deregister_by_pid(), hb_reconfig_heartbeat(), and hb_register_new_process().
#define HB_UI_NODE_CACHE_TIME_IN_MSECS (60 * 1000) |
Definition at line 186 of file master_heartbeat.h.
Referenced by hb_get_node_info_string().
#define HB_UI_NODE_CLEANUP_TIME_IN_MSECS (3600 * 1000) |
Definition at line 185 of file master_heartbeat.h.
Referenced by hb_cleanup_ui_nodes().
#define HB_VALID_CANNOT_RESOLVE_HOST_STR "cannot_resolve_host_name" |
Definition at line 173 of file master_heartbeat.h.
Referenced by hb_valid_result_string().
#define HB_VALID_GROUP_NAME_MISMATCH_STR "group_name_mismatch" |
Definition at line 171 of file master_heartbeat.h.
Referenced by hb_valid_result_string().
#define HB_VALID_IP_ADDR_MISMATCH_STR "ip_addr_mismatch" |
Definition at line 172 of file master_heartbeat.h.
Referenced by hb_valid_result_string().
#define HB_VALID_NO_ERROR_STR "no_error" |
Definition at line 169 of file master_heartbeat.h.
Referenced by hb_valid_result_string().
#define HB_VALID_UNIDENTIFIED_NODE_STR "unidentified_node" |
Definition at line 170 of file master_heartbeat.h.
Referenced by hb_valid_result_string().
typedef struct hb_cluster HB_CLUSTER |
Definition at line 240 of file master_heartbeat.h.
typedef struct hb_cluster_job_arg HB_CLUSTER_JOB_ARG |
Definition at line 318 of file master_heartbeat.h.
Definition at line 367 of file master_heartbeat.h.
typedef union hb_job_arg HB_JOB_ARG |
Definition at line 342 of file master_heartbeat.h.
typedef struct hb_job_entry HB_JOB_ENTRY |
Definition at line 352 of file master_heartbeat.h.
typedef void(* HB_JOB_FUNC) (HB_JOB_ARG *) |
Definition at line 349 of file master_heartbeat.h.
Definition at line 190 of file master_heartbeat.h.
typedef struct hb_node_entry HB_NODE_ENTRY |
Definition at line 199 of file master_heartbeat.h.
typedef struct hb_ping_host_entry HB_PING_HOST_ENTRY |
Definition at line 215 of file master_heartbeat.h.
typedef struct hb_resource HB_RESOURCE |
Definition at line 304 of file master_heartbeat.h.
typedef struct hb_resource_job_arg HB_RESOURCE_JOB_ARG |
Definition at line 326 of file master_heartbeat.h.
typedef struct hb_ui_node_entry HB_UI_NODE_ENTRY |
Definition at line 226 of file master_heartbeat.h.
enum HB_CLUSTER_JOB |
Enumerator | |
---|---|
HB_CJOB_INIT | |
HB_CJOB_HEARTBEAT | |
HB_CJOB_CALC_SCORE | |
HB_CJOB_CHECK_PING | |
HB_CJOB_FAILOVER | |
HB_CJOB_FAILBACK | |
HB_CJOB_CHECK_VALID_PING_SERVER | |
HB_CJOB_DEMOTE | |
HB_CJOB_MAX |
Definition at line 62 of file master_heartbeat.h.
enum HB_HOST_CHECK_RESULT |
Enumerator | |
---|---|
HB_HC_ELIGIBLE_LOCAL | |
HB_HC_ELIGIBLE_REMOTE | |
HB_HC_UNAUTHORIZED | |
HB_HC_FAILED |
Definition at line 145 of file master_heartbeat.h.
enum HB_NOLOG_REASON |
Enumerator | |
---|---|
HB_NOLOG_DEMOTE_ON_DISK_FAIL | |
HB_NOLOG_REMOTE_STOP | |
HB_NOLOG_MAX |
Definition at line 153 of file master_heartbeat.h.
enum HB_PING_RESULT |
Enumerator | |
---|---|
HB_PING_UNKNOWN | |
HB_PING_SUCCESS | |
HB_PING_USELESS_HOST | |
HB_PING_SYS_ERR | |
HB_PING_FAILURE |
Definition at line 45 of file master_heartbeat.h.
enum HB_PROC_STATE |
Definition at line 93 of file master_heartbeat.h.
enum HB_RESOURCE_JOB |
Definition at line 76 of file master_heartbeat.h.
enum HB_VALID_RESULT |
Enumerator | |
---|---|
HB_VALID_NO_ERROR | |
HB_VALID_UNIDENTIFIED_NODE | |
HB_VALID_GROUP_NAME_MISMATCH | |
HB_VALID_IP_ADDR_MISMATCH | |
HB_VALID_CANNOT_RESOLVE_HOST |
Definition at line 161 of file master_heartbeat.h.
int hb_activate_heartbeat | ( | void | ) |
Definition at line 6128 of file master_heartbeat.c.
References ARG_FILE_LINE, ER_ERROR_SEVERITY, ER_FAILED, ER_HB_COMMAND_EXECUTION, error(), HB_CMD_ACTIVATE_STR, hb_Is_activated, hb_master_init(), HB_RESULT_FAILURE_STR, HB_RESULT_SUCCESS_STR, hb_deactivate_info::info_started, MASTER_ER_SET, NO_ERROR, and NULL.
Referenced by css_process_activate_heartbeat().
int hb_check_request_eligibility | ( | SOCKET | sd | ) |
Definition at line 6558 of file master_heartbeat.c.
References ARG_FILE_LINE, error(), HB_HC_ELIGIBLE_LOCAL, HB_HC_ELIGIBLE_REMOTE, HB_HC_FAILED, HB_HC_UNAUTHORIZED, hb_hostname_to_sin_addr(), hb_node_entry::host_name, hb_cluster::lock, MASTER_ER_LOG_DEBUG, hb_node_entry::next, NO_ERROR, hb_cluster::nodes, pthread_mutex_lock, pthread_mutex_unlock, and rv.
Referenced by css_process_deact_stop_all(), css_process_deactivate_heartbeat(), css_process_ha_admin_info(), css_process_ha_deregister_by_args(), css_process_ha_deregister_by_pid(), css_process_ha_node_list_info(), css_process_ha_ping_host_info(), css_process_ha_process_list_info(), and css_process_ha_start_util_process().
void hb_cleanup_conn_and_start_process | ( | CSS_CONN_ENTRY * | conn, |
SOCKET | sfd | ||
) |
Definition at line 3741 of file master_heartbeat.c.
References ARG_FILE_LINE, HB_PROC_ENTRY::args, hb_resource_job_arg::args, assert, HB_PROC_ENTRY::being_shutdown, HB_PROC_ENTRY::conn, css_Master_socket_anchor, css_remove_entry_by_conn(), HB_PROC_ENTRY::curr_eof, ER_ERROR_SEVERITY, ER_HB_PROCESS_EVENT, ER_OUT_OF_VIRTUAL_MEMORY, error(), hb_resource_job_arg::ftime, HB_GET_ELAPSED_TIME, HB_JOB_TIMER_IMMEDIATELY, HB_JOB_TIMER_WAIT_A_SECOND, HB_NSTATE_MASTER, HB_NSTATE_SLAVE, HB_PSTATE_DEAD, HB_PSTATE_REGISTERED, HB_PTYPE_SERVER, hb_resource_job_queue(), hb_return_proc_by_fd(), HB_RJOB_DEMOTE_START_SHUTDOWN, HB_RJOB_PROC_START, INVALID_SOCKET, HB_PROC_ENTRY::is_curr_eof_received, hb_cluster::is_isolated, HB_PROC_ENTRY::ktime, hb_resource::lock, LSA_SET_NULL(), MASTER_ER_LOG_DEBUG, MASTER_ER_SET, hb_resource_job_arg::max_retries, NO_ERROR, NULL, HB_PROC_ENTRY::pid, hb_resource_job_arg::pid, HB_PROC_ENTRY::prev_eof, prm_get_integer_value(), PRM_ID_HA_MAX_PROCESS_START_CONFIRM, PRM_ID_HA_UNACCEPTABLE_PROC_RESTART_TIMEDIFF_IN_MSECS, pthread_mutex_lock, pthread_mutex_unlock, hb_job_arg::resource_job_arg, hb_resource_job_arg::retries, HB_PROC_ENTRY::rtime, rv, HB_PROC_ENTRY::server_hang, HB_PROC_ENTRY::sfd, HB_PROC_ENTRY::state, hb_resource::state, and HB_PROC_ENTRY::type.
Referenced by css_check_master_socket_exception(), css_master_select_error(), css_master_timeout(), and css_process_heartbeat_request().
void hb_cluster_shutdown_and_cleanup | ( | void | ) |
Definition at line 5128 of file master_heartbeat.c.
References hb_cluster_cleanup(), and hb_cluster_job_shutdown().
Referenced by css_process_kill_master(), and hb_deactivate_heartbeat().
int hb_deactivate_heartbeat | ( | void | ) |
Definition at line 6086 of file master_heartbeat.c.
References ARG_FILE_LINE, ER_ERROR_SEVERITY, ER_FAILED, ER_HB_COMMAND_EXECUTION, hb_cluster_shutdown_and_cleanup(), HB_CMD_DEACTIVATE_STR, hb_Is_activated, hb_resource_shutdown_and_cleanup(), HB_RESULT_FAILURE_STR, HB_RESULT_SUCCESS_STR, MASTER_ER_SET, NO_ERROR, and NULL.
Referenced by css_process_deactivate_heartbeat().
void hb_deregister_by_args | ( | char * | args | ) |
Definition at line 5925 of file master_heartbeat.c.
References ARG_FILE_LINE, assert, ER_HB_COMMAND_EXECUTION, ER_NOTIFICATION_SEVERITY, error(), free_and_init, HB_CMD_DEREGISTER_STR, hb_deregister_process(), HB_JOB_TIMER_IMMEDIATELY, hb_resource_job_queue(), HB_RESULT_FAILURE_STR, HB_RESULT_SUCCESS_STR, hb_return_proc_by_args(), HB_RJOB_PROC_DEREG, hb_resource::lock, MASTER_ER_SET, NO_ERROR, NULL, pthread_mutex_lock, and pthread_mutex_unlock.
Referenced by css_process_ha_deregister_by_args().
void hb_deregister_by_pid | ( | pid_t | pid | ) |
Definition at line 5875 of file master_heartbeat.c.
References ARG_FILE_LINE, assert, ER_ERROR_SEVERITY, ER_HB_COMMAND_EXECUTION, ER_NOTIFICATION_SEVERITY, error(), free_and_init, HB_CMD_DEREGISTER_STR, hb_deregister_process(), HB_JOB_TIMER_IMMEDIATELY, hb_resource_job_queue(), HB_RESULT_FAILURE_STR, HB_RESULT_SUCCESS_STR, hb_return_proc_by_pid(), HB_RJOB_PROC_DEREG, hb_resource::lock, MASTER_ER_SET, NO_ERROR, NULL, pthread_mutex_lock, and pthread_mutex_unlock.
Referenced by css_process_deregister_ha_process(), css_process_ha_deregister_by_pid(), css_process_kill_slave(), and hb_kill_all_heartbeat_process().
void hb_disable_er_log | ( | int | reason, |
const char * | msg_fmt, | ||
... | |||
) |
Definition at line 6266 of file master_heartbeat.c.
References css_Master_er_log_enable_lock, css_Master_er_log_enabled, HB_NOLOG_DEMOTE_ON_DISK_FAIL, hb_Nolog_event_msg, HB_NOLOG_REMOTE_STOP, hb_strtime(), NULL, p, pthread_mutex_lock, pthread_mutex_unlock, and rv.
Referenced by css_process_deact_stop_all(), css_process_deactivate_heartbeat(), and hb_thread_check_disk_failure().
void hb_enable_er_log | ( | void | ) |
Definition at line 6252 of file master_heartbeat.c.
References css_Master_er_log_enable_lock, css_Master_er_log_enabled, hb_Nolog_event_msg, pthread_mutex_lock, pthread_mutex_unlock, and rv.
Referenced by hb_master_init().
void hb_finish_deactivate_server_info | ( | void | ) |
Definition at line 6693 of file master_heartbeat.c.
References free_and_init, hb_deactivate_info::info_started, NULL, hb_deactivate_info::server_count, and hb_deactivate_info::server_pid_list.
Referenced by css_process_deact_confirm_no_server().
void hb_get_admin_info_string | ( | char ** | str | ) |
Definition at line 5396 of file master_heartbeat.c.
References ARG_FILE_LINE, css_Master_er_log_enable_lock, css_Master_er_log_enabled, ER_ERROR_SEVERITY, ER_OUT_OF_VIRTUAL_MEMORY, HA_ADMIN_INFO_FORMAT_STRING, HA_ADMIN_INFO_NOLOG_EVENT_FORMAT_STRING, HA_ADMIN_INFO_NOLOG_FORMAT_STRING, hb_Nolog_event_msg, MASTER_ER_SET, NULL, p, pthread_mutex_lock, pthread_mutex_unlock, rv, and strlen.
Referenced by css_process_ha_admin_info().
int hb_get_deactivating_server_count | ( | void | ) |
Definition at line 6657 of file master_heartbeat.c.
References i, hb_deactivate_info::info_started, hb_deactivate_info::server_count, and hb_deactivate_info::server_pid_list.
Referenced by css_process_deact_confirm_no_server(), and css_process_deactivate_heartbeat().
void hb_get_node_info_string | ( | char ** | str, |
bool | verbose_yn | ||
) |
Definition at line 5535 of file master_heartbeat.c.
References ARG_FILE_LINE, CUB_MAXHOSTNAMELEN, ER_ERROR_SEVERITY, ER_OUT_OF_VIRTUAL_MEMORY, hb_ui_node_entry::group_id, HA_NODE_FORMAT_STRING, HA_NODE_HEARTBEAT_GAP_FORMAT_STRING, HA_NODE_INFO_FORMAT_STRING, HA_NODE_SCORE_FORMAT_STRING, HA_UI_NODE_FORMAT_STRING, hb_cleanup_ui_nodes(), HB_GET_ELAPSED_TIME, HB_IPV4_STR_LEN, HB_MAX_GROUP_ID_LEN, hb_node_state_string(), HB_NSTATE_STR_SZ, HB_UI_NODE_CACHE_TIME_IN_MSECS, hb_valid_result_string(), hb_node_entry::heartbeat_gap, hb_node_entry::host_name, hb_ui_node_entry::host_name, hb_cluster::host_name, hb_ui_node_entry::last_recv_time, hb_cluster::lock, MASTER_ER_SET, hb_node_entry::next, hb_ui_node_entry::next, hb_cluster::nodes, NULL, hb_cluster::num_nodes, hb_cluster::num_ui_nodes, p, hb_node_entry::priority, pthread_mutex_lock, pthread_mutex_unlock, rv, hb_ui_node_entry::saddr, hb_node_entry::score, hb_node_entry::state, hb_cluster::state, strlen, hb_cluster::ui_nodes, and hb_ui_node_entry::v_result.
Referenced by css_process_ha_node_list_info(), and hb_reconfig_heartbeat().
void hb_get_ping_host_info_string | ( | char ** | str | ) |
Definition at line 5448 of file master_heartbeat.c.
References ARG_FILE_LINE, CUB_MAXHOSTNAMELEN, ER_ERROR_SEVERITY, ER_OUT_OF_VIRTUAL_MEMORY, HA_PING_HOSTS_FORMAT_STRING, HA_PING_HOSTS_INFO_FORMAT_STRING, HB_CJOB_CHECK_VALID_PING_SERVER, hb_cluster_check_valid_ping_server(), hb_cluster_is_isolated(), hb_cluster_job_set_expire_and_reorder(), HB_JOB_TIMER_IMMEDIATELY, hb_ping_result_string(), HB_PING_STR_SIZE, hb_ping_host_entry::host_name, hb_cluster::is_ping_check_enabled, hb_cluster::lock, MASTER_ER_SET, hb_ping_host_entry::next, NULL, hb_cluster::num_ping_hosts, p, hb_cluster::ping_hosts, hb_ping_host_entry::ping_result, pthread_mutex_lock, pthread_mutex_unlock, rv, and strlen.
Referenced by css_process_ha_ping_host_info().
void hb_get_process_info_string | ( | char ** | str, |
bool | verbose_yn | ||
) |
Definition at line 5645 of file master_heartbeat.c.
References ARG_FILE_LINE, HB_PROC_ENTRY::args, assert_release, HB_PROC_ENTRY::conn, css_Master_socket_anchor, css_return_entry_by_conn(), HB_PROC_ENTRY::dtime, ER_ERROR_SEVERITY, ER_OUT_OF_VIRTUAL_MEMORY, HB_PROC_ENTRY::exec_path, HA_APPLYLOG_PROCESS_FORMAT_STRING, HA_COPYLOG_PROCESS_FORMAT_STRING, HA_PROCESS_ARGV_FORMAT_STRING, HA_PROCESS_DEREGISTER_TIME_FORMAT_STRING, HA_PROCESS_EXEC_PATH_FORMAT_STRING, HA_PROCESS_INFO_FORMAT_STRING, HA_PROCESS_REGISTER_TIME_FORMAT_STRING, HA_PROCESS_SHUTDOWN_TIME_FORMAT_STRING, HA_PROCESS_START_TIME_FORMAT_STRING, HA_SERVER_PROCESS_FORMAT_STRING, HB_MAX_SZ_PROC_ARGS, HB_MAX_SZ_PROC_EXEC_PATH, hb_node_state_string(), HB_NSTATE_STR_SZ, hb_process_state_string(), HB_PSTATE_STR_SZ, HB_PTYPE_APPLYLOGDB, HB_PTYPE_COPYLOGDB, HB_PTYPE_SERVER, hb_strtime(), HB_PROC_ENTRY::ktime, hb_resource::lock, MASTER_ER_SET, socket_queue_entry::name, HB_PROC_ENTRY::next, NULL, hb_resource::num_procs, p, HB_PROC_ENTRY::pid, hb_resource::procs, pthread_mutex_lock, pthread_mutex_unlock, HB_PROC_ENTRY::rtime, rv, HB_PROC_ENTRY::state, hb_resource::state, HB_PROC_ENTRY::stime, strlen, and HB_PROC_ENTRY::type.
Referenced by css_process_ha_process_list_info().
bool hb_is_deactivation_ready | ( | void | ) |
Definition at line 6631 of file master_heartbeat.c.
References assert, HB_PROC_ENTRY::conn, INVALID_SOCKET, hb_resource::lock, HB_PROC_ENTRY::next, NULL, hb_resource::procs, pthread_mutex_lock, pthread_mutex_unlock, and HB_PROC_ENTRY::sfd.
Referenced by css_process_deact_confirm_stop_all().
bool hb_is_deactivation_started | ( | void | ) |
Definition at line 6625 of file master_heartbeat.c.
References hb_deactivate_info::info_started.
Referenced by css_process_deact_stop_all(), and css_send_to_existing_server().
bool hb_is_hang_process | ( | int | sfd | ) |
Definition at line 6748 of file master_heartbeat.c.
References hb_return_proc_by_fd(), hb_resource::lock, NULL, pthread_mutex_lock, pthread_mutex_unlock, rv, and HB_PROC_ENTRY::server_hang.
Referenced by css_send_to_existing_server().
bool hb_is_registered_process | ( | CSS_CONN_ENTRY * | conn, |
char * | args | ||
) |
Definition at line 3855 of file master_heartbeat.c.
References hb_return_proc_by_args(), hb_resource::lock, NULL, pthread_mutex_lock, pthread_mutex_unlock, and hb_resource::shutdown.
Referenced by css_process_is_registered_ha_proc().
void hb_kill_all_heartbeat_process | ( | char ** | str | ) |
Definition at line 5825 of file master_heartbeat.c.
References ARG_FILE_LINE, cubregex::count(), ER_ERROR_SEVERITY, ER_OUT_OF_VIRTUAL_MEMORY, hb_deregister_by_pid(), HB_PTYPE_APPLYLOGDB, HB_PTYPE_COPYLOGDB, i, hb_resource::lock, MASTER_ER_SET, HB_PROC_ENTRY::next, NULL, HB_PROC_ENTRY::pid, hb_resource::procs, pthread_mutex_lock, pthread_mutex_unlock, rv, and HB_PROC_ENTRY::type.
Referenced by css_process_kill_all_ha_process().
int hb_master_init | ( | void | ) |
Definition at line 4883 of file master_heartbeat.c.
References ARG_FILE_LINE, db_error_string(), ER_HB_STARTED, ER_NOTIFICATION_SEVERITY, error(), HA_DISABLED, hb_cluster_cleanup(), hb_cluster_initialize(), hb_cluster_job_initialize(), hb_cluster_job_shutdown(), hb_Deactivate_immediately, hb_enable_er_log(), hb_resource_cleanup(), hb_resource_initialize(), hb_resource_job_initialize(), hb_resource_job_shutdown(), hb_thread_initialize(), MASTER_ER_LOG_DEBUG, MASTER_ER_SET, NO_ERROR, NULL, prm_get_integer_value(), prm_get_string_value(), PRM_ID_HA_NODE_LIST, PRM_ID_HA_PORT_ID, PRM_ID_HA_REPLICA_LIST, hb_cluster::shutdown, hb_resource::shutdown, hb_job::shutdown, sysprm_reload_and_init(), and util_log_write_errstr().
Referenced by hb_activate_heartbeat(), and main().
int hb_prepare_deactivate_heartbeat | ( | void | ) |
Definition at line 6044 of file master_heartbeat.c.
References ARG_FILE_LINE, assert, ER_FAILED, ER_HB_COMMAND_EXECUTION, ER_NOTIFICATION_SEVERITY, error(), HB_CMD_DEACTIVATE_STR, HB_JOB_TIMER_IMMEDIATELY, hb_resource_job_queue(), HB_RJOB_CLEANUP_ALL, hb_resource::lock, MASTER_ER_SET, NO_ERROR, NULL, pthread_mutex_lock, pthread_mutex_unlock, rv, and hb_resource::shutdown.
Referenced by css_process_deact_stop_all().
void hb_reconfig_heartbeat | ( | char ** | str | ) |
Definition at line 6012 of file master_heartbeat.c.
References ARG_FILE_LINE, ER_ERROR_SEVERITY, ER_HB_COMMAND_EXECUTION, error(), HB_CMD_RELOAD_STR, hb_get_node_info_string(), hb_reload_config(), HB_RESULT_FAILURE_STR, HB_RESULT_SUCCESS_STR, MASTER_ER_SET, and NULL.
Referenced by css_process_reconfig_heartbeat().
void hb_register_new_process | ( | CSS_CONN_ENTRY * | conn | ) |
Definition at line 3890 of file master_heartbeat.c.
References ARG_FILE_LINE, hbp_proc_register::args, HB_PROC_ENTRY::args, assert, HB_PROC_ENTRY::changemode_gap, HB_PROC_ENTRY::conn, css_Master_socket_anchor, css_receive_heartbeat_data(), css_remove_entry_by_conn(), ER_ERROR_SEVERITY, ER_HB_PROCESS_EVENT, hbp_proc_register::exec_path, HB_PROC_ENTRY::exec_path, css_conn_entry::fd, HB_PROC_ENTRY::frtime, hb_alloc_new_proc(), HB_BUFFER_SZ, hb_process_state_string(), HB_PSTATE_NOT_REGISTERED, HB_PSTATE_REGISTERED, HB_PSTATE_REGISTERED_AND_STANDBY, HB_PSTATE_STARTED, HB_PSTATE_UNKNOWN, HB_PTYPE_SERVER, HB_RESULT_FAILURE_STR, HB_RESULT_SUCCESS_STR, hb_return_proc_by_args(), hb_resource::lock, MASTER_ER_LOG_DEBUG, MASTER_ER_SET, NO_ERRORS, ntohl(), NULL, hb_resource::num_procs, hbp_proc_register::pid, HB_PROC_ENTRY::pid, pthread_mutex_lock, pthread_mutex_unlock, HB_PROC_ENTRY::rtime, rv, HB_PROC_ENTRY::server_hang, HB_PROC_ENTRY::sfd, hb_resource::shutdown, HB_PROC_ENTRY::state, hbp_proc_register::type, and HB_PROC_ENTRY::type.
Referenced by css_process_register_ha_process().
void hb_resource_receive_changemode | ( | CSS_CONN_ENTRY * | conn | ) |
Definition at line 4096 of file master_heartbeat.c.
References ARG_FILE_LINE, HB_PROC_ENTRY::args, HB_PROC_ENTRY::changemode_gap, css_ha_server_state_string(), css_receive_heartbeat_data(), ER_ERROR_SEVERITY, ER_HA_GENERIC_ERROR, css_conn_entry::fd, HA_SERVER_STATE_ACTIVE, HA_SERVER_STATE_STANDBY, HA_SERVER_STATE_TO_BE_ACTIVE, HA_SERVER_STATE_TO_BE_STANDBY, HB_NSTATE_SLAVE, HB_PSTATE_DEREGISTERED, HB_PSTATE_REGISTERED_AND_ACTIVE, HB_PSTATE_REGISTERED_AND_STANDBY, HB_PSTATE_REGISTERED_AND_TO_BE_ACTIVE, HB_PSTATE_REGISTERED_AND_TO_BE_STANDBY, hb_return_proc_by_fd(), hb_cluster::lock, hb_resource::lock, MASTER_ER_SET, NO_ERRORS, ntohl(), NULL, HB_PROC_ENTRY::pid, pthread_mutex_lock, pthread_mutex_unlock, rv, hb_cluster::state, HB_PROC_ENTRY::state, and hb_resource::state.
Referenced by css_process_change_ha_mode().
void hb_resource_receive_get_eof | ( | CSS_CONN_ENTRY * | conn | ) |
Definition at line 4257 of file master_heartbeat.c.
References ARG_FILE_LINE, css_receive_heartbeat_data(), HB_PROC_ENTRY::curr_eof, css_conn_entry::fd, HB_PSTATE_REGISTERED_AND_ACTIVE, hb_return_proc_by_fd(), hb_thread_cluster_worker(), HB_PROC_ENTRY::is_curr_eof_received, hb_resource::lock, LSA_AS_ARGS, MASTER_ER_LOG_DEBUG, NO_ERRORS, NULL, OR_ALIGNED_BUF, OR_ALIGNED_BUF_SIZE, OR_ALIGNED_BUF_START, OR_LOG_LSA_ALIGNED_SIZE, or_unpack_log_lsa(), pthread_mutex_lock, pthread_mutex_unlock, rv, and HB_PROC_ENTRY::state.
Referenced by css_process_get_eof().
void hb_resource_shutdown_and_cleanup | ( | void | ) |
Definition at line 5066 of file master_heartbeat.c.
References hb_resource_cleanup(), and hb_resource_job_shutdown().
Referenced by css_process_kill_master(), and hb_deactivate_heartbeat().
int hb_return_proc_state_by_fd | ( | int | sfd | ) |
Definition at line 6711 of file master_heartbeat.c.
References HB_PSTATE_DEAD, HB_PSTATE_UNKNOWN, hb_return_proc_by_fd(), if(), hb_resource::lock, NULL, pthread_mutex_lock, pthread_mutex_unlock, rv, HB_PROC_ENTRY::server_hang, and HB_PROC_ENTRY::state.
Referenced by css_process_server_state().
void hb_start_deactivate_server_info | ( | void | ) |
Definition at line 6611 of file master_heartbeat.c.
References assert, free_and_init, hb_deactivate_info::info_started, NULL, hb_deactivate_info::server_count, and hb_deactivate_info::server_pid_list.
Referenced by css_process_deact_stop_all().
int hb_start_util_process | ( | char * | args | ) |
Definition at line 6178 of file master_heartbeat.c.
References ARG_FILE_LINE, argvp, css_master_cleanup(), envvar_bindir_file(), ER_ERROR_SEVERITY, ER_FAILED, ER_HB_COMMAND_EXECUTION, ER_NOTIFICATION_SEVERITY, ERR_CSS_CANNOT_FORK, executable_path, HB_CMD_UTIL_START_STR, HB_MAX_NUM_PROC_ARGV, HB_MAX_SZ_PROC_ARGV, HB_RESULT_FAILURE_STR, hb_return_proc_by_args(), i, hb_resource::lock, MASTER_ER_SET, NO_ERROR, NULL, pid, pthread_mutex_lock, and pthread_mutex_unlock.
Referenced by css_process_ha_start_util_process().
HB_JOB* cluster_Jobs |
Definition at line 242 of file master_heartbeat.c.
Referenced by css_process_kill_master().
HB_CLUSTER* hb_Cluster |
Definition at line 240 of file master_heartbeat.c.
Referenced by css_process_kill_master().
bool hb_Deactivate_immediately |
Definition at line 244 of file master_heartbeat.c.
Referenced by css_process_deact_stop_all(), hb_master_init(), hb_resource_job_cleanup_all(), and hb_resource_job_confirm_cleanup_all().
HB_RESOURCE* hb_Resource |
Definition at line 241 of file master_heartbeat.c.
Referenced by css_process_kill_master().
HB_JOB* resource_Jobs |
Definition at line 243 of file master_heartbeat.c.
Referenced by css_process_kill_master().