CUBRID Engine
latest
|
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
#include <netdb.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <signal.h>
#include <errno.h>
#include <sys/wait.h>
#include <assert.h>
#include <unistd.h>
#include <fcntl.h>
#include <pthread.h>
#include <syslog.h>
#include "connection_cl.h"
#include "dbi.h"
#include "environment_variable.h"
#include "error_context.hpp"
#include "heartbeat.h"
#include "master_util.h"
#include "master_heartbeat.h"
#include "master_request.h"
#include "message_catalog.h"
#include "object_representation.h"
#include "porting.h"
#include "tcp.h"
#include "utility.h"
Go to the source code of this file.
Classes | |
struct | hb_deactivate_info |
Macros | |
#define | HB_INFO_STR_MAX 8192 |
#define | SERVER_DEREG_MAX_POLL_COUNT 10 |
#define | ENTER_FUNC() |
#define | EXIT_FUNC() |
#define | HA_NODE_INFO_FORMAT_STRING " HA-Node Info (current %s, state %s)\n" |
#define | HA_NODE_FORMAT_STRING " Node %s (priority %d, state %s)\n" |
#define | HA_UI_NODE_FORMAT_STRING " * Node %s (ip %s, group %s, state %s)\n" |
#define | HA_NODE_SCORE_FORMAT_STRING " - score %d\n" |
#define | HA_NODE_HEARTBEAT_GAP_FORMAT_STRING " - missed heartbeat %d\n" |
#define | HA_PROCESS_INFO_FORMAT_STRING " HA-Process Info (master %d, state %s)\n" |
#define | HA_SERVER_PROCESS_FORMAT_STRING " Server %s (pid %d, state %s)\n" |
#define | HA_COPYLOG_PROCESS_FORMAT_STRING " Copylogdb %s (pid %d, state %s)\n" |
#define | HA_APPLYLOG_PROCESS_FORMAT_STRING " Applylogdb %s (pid %d, state %s)\n" |
#define | HA_PROCESS_EXEC_PATH_FORMAT_STRING " - exec-path [%s] \n" |
#define | HA_PROCESS_ARGV_FORMAT_STRING " - argv [%s] \n" |
#define | HA_PROCESS_REGISTER_TIME_FORMAT_STRING " - registered-time %s\n" |
#define | HA_PROCESS_DEREGISTER_TIME_FORMAT_STRING " - deregistered-time %s\n" |
#define | HA_PROCESS_SHUTDOWN_TIME_FORMAT_STRING " - shutdown-time %s\n" |
#define | HA_PROCESS_START_TIME_FORMAT_STRING " - start-time %s\n" |
#define | HA_PING_HOSTS_INFO_FORMAT_STRING " HA-Ping Host Info (PING check %s)\n" |
#define | HA_PING_HOSTS_FORMAT_STRING " %-20s %s\n" |
#define | HA_ADMIN_INFO_FORMAT_STRING " HA-Admin Info\n" |
#define | HA_ADMIN_INFO_NOLOG_FORMAT_STRING " Error Logging: disabled\n" |
#define | HA_ADMIN_INFO_NOLOG_EVENT_FORMAT_STRING " %s\n" |
#define | PING_COMMAND_FORMAT |
Typedefs | |
typedef struct hb_deactivate_info | HB_DEACTIVATE_INFO |
Variables | |
HB_CLUSTER * | hb_Cluster = NULL |
HB_RESOURCE * | hb_Resource = NULL |
HB_JOB * | cluster_Jobs = NULL |
HB_JOB * | resource_Jobs = NULL |
bool | hb_Deactivate_immediately = false |
static char | hb_Nolog_event_msg [LINE_MAX] = "" |
static HB_DEACTIVATE_INFO | hb_Deactivate_info = { NULL, 0, false } |
static bool | hb_Is_activated = true |
static HB_JOB_FUNC | hb_cluster_jobs [] |
static HB_JOB_FUNC | hb_resource_jobs [] |
#define ENTER_FUNC | ( | ) |
Definition at line 66 of file master_heartbeat.c.
Referenced by hb_cluster_job_calc_score(), hb_cluster_job_check_ping(), hb_cluster_job_demote(), hb_cluster_job_failback(), and hb_cluster_job_failover().
#define EXIT_FUNC | ( | ) |
Definition at line 71 of file master_heartbeat.c.
Referenced by hb_cluster_job_check_ping().
#define HA_ADMIN_INFO_FORMAT_STRING " HA-Admin Info\n" |
Definition at line 316 of file master_heartbeat.c.
Referenced by hb_get_admin_info_string().
#define HA_ADMIN_INFO_NOLOG_EVENT_FORMAT_STRING " %s\n" |
Definition at line 320 of file master_heartbeat.c.
Referenced by hb_get_admin_info_string().
#define HA_ADMIN_INFO_NOLOG_FORMAT_STRING " Error Logging: disabled\n" |
Definition at line 318 of file master_heartbeat.c.
Referenced by hb_get_admin_info_string().
#define HA_APPLYLOG_PROCESS_FORMAT_STRING " Applylogdb %s (pid %d, state %s)\n" |
Definition at line 296 of file master_heartbeat.c.
Referenced by hb_get_process_info_string().
#define HA_COPYLOG_PROCESS_FORMAT_STRING " Copylogdb %s (pid %d, state %s)\n" |
Definition at line 294 of file master_heartbeat.c.
Referenced by hb_get_process_info_string().
#define HA_NODE_FORMAT_STRING " Node %s (priority %d, state %s)\n" |
Definition at line 281 of file master_heartbeat.c.
Referenced by hb_get_node_info_string().
#define HA_NODE_HEARTBEAT_GAP_FORMAT_STRING " - missed heartbeat %d\n" |
Definition at line 287 of file master_heartbeat.c.
Referenced by hb_get_node_info_string().
#define HA_NODE_INFO_FORMAT_STRING " HA-Node Info (current %s, state %s)\n" |
Definition at line 279 of file master_heartbeat.c.
Referenced by hb_get_node_info_string().
#define HA_NODE_SCORE_FORMAT_STRING " - score %d\n" |
Definition at line 285 of file master_heartbeat.c.
Referenced by hb_get_node_info_string().
#define HA_PING_HOSTS_FORMAT_STRING " %-20s %s\n" |
Definition at line 313 of file master_heartbeat.c.
Referenced by hb_get_ping_host_info_string().
#define HA_PING_HOSTS_INFO_FORMAT_STRING " HA-Ping Host Info (PING check %s)\n" |
Definition at line 311 of file master_heartbeat.c.
Referenced by hb_get_ping_host_info_string().
#define HA_PROCESS_ARGV_FORMAT_STRING " - argv [%s] \n" |
Definition at line 300 of file master_heartbeat.c.
Referenced by hb_get_process_info_string().
#define HA_PROCESS_DEREGISTER_TIME_FORMAT_STRING " - deregistered-time %s\n" |
Definition at line 304 of file master_heartbeat.c.
Referenced by hb_get_process_info_string().
#define HA_PROCESS_EXEC_PATH_FORMAT_STRING " - exec-path [%s] \n" |
Definition at line 298 of file master_heartbeat.c.
Referenced by hb_get_process_info_string().
#define HA_PROCESS_INFO_FORMAT_STRING " HA-Process Info (master %d, state %s)\n" |
Definition at line 290 of file master_heartbeat.c.
Referenced by hb_get_process_info_string().
#define HA_PROCESS_REGISTER_TIME_FORMAT_STRING " - registered-time %s\n" |
Definition at line 302 of file master_heartbeat.c.
Referenced by hb_get_process_info_string().
#define HA_PROCESS_SHUTDOWN_TIME_FORMAT_STRING " - shutdown-time %s\n" |
Definition at line 306 of file master_heartbeat.c.
Referenced by hb_get_process_info_string().
#define HA_PROCESS_START_TIME_FORMAT_STRING " - start-time %s\n" |
Definition at line 308 of file master_heartbeat.c.
Referenced by hb_get_process_info_string().
#define HA_SERVER_PROCESS_FORMAT_STRING " Server %s (pid %d, state %s)\n" |
Definition at line 292 of file master_heartbeat.c.
Referenced by hb_get_process_info_string().
#define HA_UI_NODE_FORMAT_STRING " * Node %s (ip %s, group %s, state %s)\n" |
Definition at line 283 of file master_heartbeat.c.
Referenced by hb_get_node_info_string().
#define HB_INFO_STR_MAX 8192 |
Definition at line 63 of file master_heartbeat.c.
Referenced by hb_cluster_job_calc_score(), hb_cluster_job_demote(), hb_cluster_job_failback(), hb_cluster_job_failover(), hb_resource_job_change_mode(), and hb_resource_job_confirm_start().
#define PING_COMMAND_FORMAT |
Referenced by hb_check_ping().
#define SERVER_DEREG_MAX_POLL_COUNT 10 |
Definition at line 64 of file master_heartbeat.c.
typedef struct hb_deactivate_info HB_DEACTIVATE_INFO |
Definition at line 76 of file master_heartbeat.c.
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().
|
static |
Definition at line 1998 of file master_heartbeat.c.
References are_hostnames_equal(), hb_list_add(), HB_NSTATE_UNKNOWN, hb_node_entry::heartbeat_gap, hb_node_entry::host_name, hb_cluster::host_name, hb_node_entry::last_recv_hbtime, hb_node_entry::next, hb_cluster::nodes, NULL, p, hb_node_entry::prev, hb_node_entry::priority, hb_node_entry::score, and hb_node_entry::state.
Referenced by hb_cluster_load_group_and_node_list().
|
static |
Definition at line 2078 of file master_heartbeat.c.
References hb_list_add(), HB_PING_UNKNOWN, hb_ping_host_entry::host_name, hb_ping_host_entry::next, NULL, p, hb_cluster::ping_hosts, hb_ping_host_entry::ping_result, and hb_ping_host_entry::prev.
Referenced by hb_cluster_load_ping_host_list().
|
static |
Definition at line 394 of file master_heartbeat.c.
References NULL.
Referenced by hb_job_queue(), and hb_job_set_expire_and_reorder().
|
static |
Definition at line 2318 of file master_heartbeat.c.
References assert, hb_ui_node_entry::group_id, hb_list_add(), hb_return_ui_node(), HB_VALID_CANNOT_RESOLVE_HOST, HB_VALID_GROUP_NAME_MISMATCH, HB_VALID_IP_ADDR_MISMATCH, HB_VALID_UNIDENTIFIED_NODE, hb_ui_node_entry::host_name, hb_ui_node_entry::last_recv_time, hb_ui_node_entry::next, NULL, hb_cluster::num_ui_nodes, hb_ui_node_entry::prev, hb_ui_node_entry::saddr, strncpy_bufsize, hb_cluster::ui_nodes, and hb_ui_node_entry::v_result.
Referenced by hb_cluster_receive_heartbeat().
|
static |
Definition at line 3577 of file master_heartbeat.c.
References HB_PROC_ENTRY::being_shutdown, HB_PROC_ENTRY::curr_eof, hb_list_add(), HB_PSTATE_UNKNOWN, HB_PROC_ENTRY::is_curr_eof_received, LSA_SET_NULL(), HB_PROC_ENTRY::next, NULL, p, HB_PROC_ENTRY::prev, HB_PROC_ENTRY::prev_eof, hb_resource::procs, HB_PROC_ENTRY::server_hang, and HB_PROC_ENTRY::state.
Referenced by hb_register_new_process().
|
static |
Definition at line 6323 of file master_heartbeat.c.
References are_hostnames_equal(), ARG_FILE_LINE, ER_ERROR_SEVERITY, ER_HB_NODE_EVENT, HB_PING_FAILURE, HB_PING_SUCCESS, HB_PING_SYS_ERR, HB_PING_USELESS_HOST, hb_node_entry::host_name, MASTER_ER_SET, hb_node_entry::next, NO_ERROR, hb_cluster::nodes, NULL, PING_COMMAND_FORMAT, and str_to_int32().
Referenced by hb_cluster_check_valid_ping_server(), and hb_cluster_job_check_ping().
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().
|
static |
Definition at line 2375 of file master_heartbeat.c.
References HB_GET_ELAPSED_TIME, hb_remove_ui_node(), HB_UI_NODE_CLEANUP_TIME_IN_MSECS, hb_ui_node_entry::last_recv_time, hb_ui_node_entry::next, and NULL.
Referenced by hb_get_node_info_string().
|
static |
Definition at line 1439 of file master_heartbeat.c.
References ARG_FILE_LINE, ER_FAILED, HB_GET_ELAPSED_TIME, HB_IS_INITIALIZED_TIME, HB_NODE_SCORE_MASTER, HB_NODE_SCORE_SLAVE, HB_NODE_SCORE_TO_BE_MASTER, HB_NODE_SCORE_UNKNOWN, HB_NSTATE_MASTER, HB_NSTATE_REPLICA, HB_NSTATE_SLAVE, HB_NSTATE_TO_BE_MASTER, HB_NSTATE_TO_BE_SLAVE, HB_NSTATE_UNKNOWN, hb_node_entry::heartbeat_gap, hb_node_entry::last_recv_hbtime, hb_cluster::master, MASTER_ER_LOG_DEBUG, hb_cluster::myself, hb_node_entry::next, hb_cluster::nodes, NULL, hb_node_entry::priority, prm_get_integer_value(), PRM_ID_HA_CALC_SCORE_INTERVAL_IN_MSECS, PRM_ID_HA_MAX_HEARTBEAT_GAP, hb_node_entry::score, hb_node_entry::state, and hb_cluster::state.
Referenced by hb_cluster_job_calc_score(), and hb_cluster_job_failover().
|
static |
Definition at line 1353 of file master_heartbeat.c.
References hb_check_ping(), HB_PING_SUCCESS, hb_ping_host_entry::host_name, hb_ping_host_entry::next, hb_cluster::num_ping_hosts, hb_cluster::ping_hosts, and hb_ping_host_entry::ping_result.
Referenced by hb_cluster_initialize(), hb_cluster_job_check_valid_ping_server(), hb_get_ping_host_info_string(), and hb_reload_config().
|
static |
Definition at line 5079 of file master_heartbeat.c.
References are_hostnames_equal(), hb_cluster_remove_all_nodes(), hb_cluster_remove_all_ping_hosts(), hb_cluster_remove_all_ui_nodes(), hb_cluster_send_heartbeat_req(), HB_NSTATE_UNKNOWN, hb_node_entry::heartbeat_gap, hb_node_entry::host_name, hb_cluster::host_name, INVALID_SOCKET, hb_cluster::lock, hb_cluster::master, hb_cluster::myself, hb_node_entry::next, hb_cluster::nodes, NULL, hb_cluster::num_ping_hosts, hb_cluster::num_ui_nodes, hb_cluster::ping_hosts, pthread_mutex_lock, pthread_mutex_unlock, rv, hb_cluster::sfd, hb_cluster::shutdown, hb_cluster::state, and hb_cluster::ui_nodes.
Referenced by hb_cluster_shutdown_and_cleanup(), and hb_master_init().
Definition at line 4595 of file master_heartbeat.c.
References ARG_FILE_LINE, CUB_MAXHOSTNAMELEN, ER_BO_UNABLE_TO_FIND_HOSTNAME, ER_ERROR_SEVERITY, ER_FAILED, ER_OUT_OF_VIRTUAL_MEMORY, ER_PRM_BAD_VALUE, ERR_CSS_TCP_DATAGRAM_BIND, ERR_CSS_TCP_DATAGRAM_SOCKET, GETHOSTNAME, HA_GET_MODE, HA_MODE_REPLICA, hb_cluster_check_valid_ping_server(), hb_cluster_load_group_and_node_list(), hb_cluster_load_ping_host_list(), HB_NSTATE_REPLICA, HB_NSTATE_SLAVE, hb_cluster::hide_to_demote, hb_cluster::host_name, htonl(), htons(), INVALID_SOCKET, hb_cluster::is_isolated, hb_cluster::is_ping_check_enabled, hb_cluster::lock, hb_cluster::master, MASTER_ER_LOG_DEBUG, MASTER_ER_SET, MASTER_ER_SET_WITH_OSERROR, hb_cluster::myself, NO_ERROR, hb_cluster::nodes, NULL, hb_cluster::num_nodes, hb_cluster::num_ping_hosts, hb_cluster::num_ui_nodes, hb_cluster::ping_hosts, prm_get_integer_value(), prm_get_name(), prm_get_string_value(), PRM_ID_HA_NODE_LIST, PRM_ID_HA_PING_HOSTS, PRM_ID_HA_PORT_ID, pthread_mutex_init, pthread_mutex_lock, pthread_mutex_unlock, rv, hb_cluster::sfd, hb_cluster::shutdown, hb_cluster::state, and hb_cluster::ui_nodes.
Referenced by hb_master_init().
|
static |
Definition at line 744 of file master_heartbeat.c.
References HB_NSTATE_REPLICA, HB_NSTATE_UNKNOWN, hb_cluster::myself, hb_node_entry::next, hb_cluster::nodes, and hb_node_entry::state.
Referenced by hb_cluster_job_calc_score(), hb_cluster_job_check_valid_ping_server(), and hb_get_ping_host_info_string().
|
static |
Definition at line 767 of file master_heartbeat.c.
References HB_GET_ELAPSED_TIME, hb_node_entry::last_recv_hbtime, hb_cluster::myself, hb_node_entry::next, hb_cluster::nodes, NULL, prm_get_integer_value(), and PRM_ID_HA_HEARTBEAT_INTERVAL_IN_MSECS.
Referenced by hb_cluster_job_calc_score(), and hb_cluster_job_check_ping().
|
static |
Definition at line 794 of file master_heartbeat.c.
References ARG_FILE_LINE, assert, hb_job_arg::cluster_job_arg, ENTER_FUNC, ER_ERROR_SEVERITY, ER_HB_NODE_EVENT, error(), free_and_init, HB_CJOB_CALC_SCORE, HB_CJOB_CHECK_PING, HB_CJOB_FAILBACK, HB_CJOB_FAILOVER, hb_cluster_calc_score(), hb_cluster_is_isolated(), hb_cluster_is_received_heartbeat_from_all(), hb_cluster_job_queue(), hb_cluster_request_heartbeat_to_all(), hb_help_sprint_nodes_info(), hb_help_sprint_ping_host_info(), HB_INFO_STR_MAX, HB_JOB_TIMER_IMMEDIATELY, HB_JOB_TIMER_WAIT_100_MILLISECOND, HB_JOB_TIMER_WAIT_500_MILLISECOND, HB_NSTATE_MASTER, HB_NSTATE_REPLICA, HB_NSTATE_SLAVE, HB_NSTATE_TO_BE_MASTER, hb_cluster::hide_to_demote, hb_cluster::is_isolated, hb_cluster::lock, hb_cluster::master, MASTER_ER_LOG_DEBUG, MASTER_ER_SET, hb_cluster::myself, NO_ERROR, NULL, hb_cluster::num_ping_hosts, hb_cluster_job_arg::ping_check_count, hb_node_entry::priority, prm_get_integer_value(), PRM_ID_HA_CALC_SCORE_INTERVAL_IN_MSECS, PRM_ID_HA_FAILOVER_WAIT_TIME_IN_MSECS, pthread_mutex_lock, pthread_mutex_unlock, hb_cluster_job_arg::retries, rv, SLEEP_MILISEC, hb_node_entry::state, and hb_cluster::state.
|
static |
Definition at line 945 of file master_heartbeat.c.
References ARG_FILE_LINE, assert, hb_job_arg::cluster_job_arg, ENTER_FUNC, ER_HB_NODE_EVENT, ER_NOTIFICATION_SEVERITY, error(), EXIT_FUNC, free_and_init, hb_check_ping(), HB_CJOB_CALC_SCORE, HB_CJOB_CHECK_PING, HB_CJOB_FAILBACK, HB_CJOB_FAILOVER, hb_cluster_is_received_heartbeat_from_all(), hb_cluster_job_queue(), hb_cluster_request_heartbeat_to_all(), HB_JOB_TIMER_IMMEDIATELY, HB_JOB_TIMER_WAIT_500_MILLISECOND, HB_MAX_PING_CHECK, HB_NSTATE_MASTER, HB_NSTATE_SLAVE, HB_PING_FAILURE, HB_PING_SUCCESS, hb_ping_host_entry::host_name, hb_cluster::is_ping_check_enabled, hb_cluster::lock, MASTER_ER_SET, hb_ping_host_entry::next, NO_ERROR, NULL, hb_cluster::num_ping_hosts, hb_cluster_job_arg::ping_check_count, hb_cluster::ping_hosts, hb_ping_host_entry::ping_result, prm_get_integer_value(), PRM_ID_HA_CALC_SCORE_INTERVAL_IN_MSECS, PRM_ID_HA_FAILOVER_WAIT_TIME_IN_MSECS, pthread_mutex_lock, pthread_mutex_unlock, rv, and hb_cluster::state.
|
static |
Definition at line 1383 of file master_heartbeat.c.
References ARG_FILE_LINE, assert, ER_ERROR_SEVERITY, ER_HB_NODE_EVENT, error(), HB_CJOB_CHECK_VALID_PING_SERVER, hb_cluster_check_valid_ping_server(), hb_cluster_is_isolated(), hb_cluster_job_queue(), HB_DEFAULT_CHECK_VALID_PING_SERVER_INTERVAL_IN_MSECS, HB_TEMP_CHECK_VALID_PING_SERVER_INTERVAL_IN_MSECS, hb_cluster::is_ping_check_enabled, hb_cluster::lock, MASTER_ER_SET, NO_ERROR, NULL, hb_cluster::num_ping_hosts, pthread_mutex_lock, pthread_mutex_unlock, and rv.
|
static |
Definition at line 1147 of file master_heartbeat.c.
References ARG_FILE_LINE, assert, hb_job_arg::cluster_job_arg, ENTER_FUNC, ER_ERROR_SEVERITY, ER_HB_NODE_EVENT, error(), free_and_init, HB_CJOB_DEMOTE, hb_cluster_job_queue(), hb_cluster_request_heartbeat_to_all(), hb_help_sprint_nodes_info(), hb_help_sprint_ping_host_info(), HB_INFO_STR_MAX, HB_JOB_TIMER_WAIT_A_SECOND, HB_MAX_WAIT_FOR_NEW_MASTER, HB_NSTATE_MASTER, HB_NSTATE_SLAVE, HB_NSTATE_UNKNOWN, hb_cluster::hide_to_demote, hb_cluster::is_isolated, hb_cluster::lock, MASTER_ER_LOG_DEBUG, MASTER_ER_SET, hb_cluster::myself, hb_node_entry::next, NO_ERROR, hb_cluster::nodes, NULL, hb_cluster::num_ping_hosts, pthread_mutex_lock, pthread_mutex_unlock, hb_cluster_job_arg::retries, rv, hb_node_entry::state, hb_cluster::state, and hb_resource::state.
|
static |
Definition at line 1929 of file master_heartbeat.c.
References hb_job_dequeue().
Referenced by hb_thread_cluster_worker().
|
static |
Definition at line 1250 of file master_heartbeat.c.
References ARG_FILE_LINE, assert, cubregex::count(), ENTER_FUNC, ER_ERROR_SEVERITY, ER_HB_NODE_EVENT, ER_OUT_OF_VIRTUAL_MEMORY, error(), free_and_init, HB_CJOB_CALC_SCORE, hb_cluster_job_queue(), hb_cluster_request_heartbeat_to_all(), hb_help_sprint_nodes_info(), hb_help_sprint_ping_host_info(), HB_INFO_STR_MAX, hb_kill_process(), HB_NSTATE_SLAVE, HB_PTYPE_SERVER, hb_cluster::lock, hb_resource::lock, MASTER_ER_SET, hb_cluster::myself, HB_PROC_ENTRY::next, NO_ERROR, NULL, hb_cluster::num_ping_hosts, HB_PROC_ENTRY::pid, prm_get_integer_value(), PRM_ID_HA_CALC_SCORE_INTERVAL_IN_MSECS, hb_resource::procs, pthread_mutex_lock, pthread_mutex_unlock, hb_node_entry::state, hb_cluster::state, hb_resource::state, and HB_PROC_ENTRY::type.
|
static |
Definition at line 1087 of file master_heartbeat.c.
References ARG_FILE_LINE, assert, ENTER_FUNC, ER_ERROR_SEVERITY, ER_HB_NODE_EVENT, error(), free_and_init, HB_CJOB_CALC_SCORE, hb_cluster_calc_score(), hb_cluster_job_queue(), hb_cluster_request_heartbeat_to_all(), hb_help_sprint_nodes_info(), hb_help_sprint_ping_host_info(), HB_INFO_STR_MAX, HB_JOB_TIMER_IMMEDIATELY, HB_NSTATE_MASTER, HB_NSTATE_SLAVE, hb_resource_job_set_expire_and_reorder(), HB_RJOB_CHANGE_MODE, hb_cluster::lock, hb_cluster::master, MASTER_ER_SET, hb_cluster::myself, NO_ERROR, NULL, hb_cluster::num_ping_hosts, hb_node_entry::priority, prm_get_integer_value(), PRM_ID_HA_CALC_SCORE_INTERVAL_IN_MSECS, pthread_mutex_lock, pthread_mutex_unlock, rv, hb_cluster::state, and hb_resource::state.
|
static |
Definition at line 716 of file master_heartbeat.c.
References assert, error(), free_and_init, HB_CJOB_HEARTBEAT, hb_cluster_job_queue(), hb_cluster_request_heartbeat_to_all(), hb_cluster::hide_to_demote, hb_cluster::lock, NO_ERROR, NULL, prm_get_integer_value(), PRM_ID_HA_HEARTBEAT_INTERVAL_IN_MSECS, pthread_mutex_lock, pthread_mutex_unlock, and rv.
|
static |
Definition at line 690 of file master_heartbeat.c.
References assert, error(), free_and_init, HB_CJOB_CALC_SCORE, HB_CJOB_CHECK_VALID_PING_SERVER, HB_CJOB_HEARTBEAT, hb_cluster_job_queue(), HB_JOB_TIMER_IMMEDIATELY, NO_ERROR, NULL, prm_get_integer_value(), and PRM_ID_HA_INIT_TIMER_IN_MSECS.
|
static |
Definition at line 4555 of file master_heartbeat.c.
References ARG_FILE_LINE, assert, ER_ERROR_SEVERITY, ER_FAILED, ER_OUT_OF_VIRTUAL_MEMORY, error(), HB_CJOB_INIT, hb_cluster_job_queue(), hb_cluster_jobs, HB_JOB_TIMER_IMMEDIATELY, hb_job::job_funcs, hb_job::jobs, hb_job::lock, MASTER_ER_SET, NO_ERROR, NULL, hb_job::num_jobs, pthread_mutex_init, pthread_mutex_lock, pthread_mutex_unlock, rv, and hb_job::shutdown.
Referenced by hb_master_init().
|
static |
Definition at line 1943 of file master_heartbeat.c.
References ARG_FILE_LINE, ER_FAILED, HB_CJOB_MAX, hb_job_queue(), and MASTER_ER_LOG_DEBUG.
Referenced by hb_cluster_job_calc_score(), hb_cluster_job_check_ping(), hb_cluster_job_check_valid_ping_server(), hb_cluster_job_demote(), hb_cluster_job_failback(), hb_cluster_job_failover(), hb_cluster_job_heartbeat(), hb_cluster_job_init(), hb_cluster_job_initialize(), and hb_resource_job_demote_confirm_shutdown().
|
static |
Definition at line 1962 of file master_heartbeat.c.
References ARG_FILE_LINE, ER_FAILED, HB_CJOB_MAX, hb_job_set_expire_and_reorder(), MASTER_ER_LOG_DEBUG, and NO_ERROR.
Referenced by hb_cluster_receive_heartbeat(), hb_get_ping_host_info_string(), and hb_reload_config().
|
static |
Definition at line 1980 of file master_heartbeat.c.
References hb_job_shutdown().
Referenced by hb_cluster_shutdown_and_cleanup(), and hb_master_init().
|
static |
Definition at line 2419 of file master_heartbeat.c.
References are_hostnames_equal(), ARG_FILE_LINE, ER_FAILED, hb_cluster::group_id, hb_add_node_to_cluster(), HB_NSTATE_REPLICA, HB_REPLICA_PRIORITY, hb_node_entry::host_name, hb_cluster::host_name, MASTER_ER_LOG_DEBUG, hb_cluster::myself, NULL, p, hb_node_entry::priority, hb_cluster::state, and strncpy_bufsize.
Referenced by hb_cluster_initialize(), and hb_reload_config().
|
static |
Definition at line 2147 of file master_heartbeat.c.
References hb_add_ping_host(), NULL, and strncpy_bufsize.
Referenced by hb_cluster_initialize(), and hb_reload_config().
|
static |
Definition at line 1624 of file master_heartbeat.c.
References are_hostnames_equal(), ARG_FILE_LINE, hbp_header::dest_host_name, ER_ERROR_SEVERITY, ER_HB_NODE_EVENT, hbp_header::group_id, hb_cluster::group_id, hb_add_ui_node(), HB_CJOB_CALC_SCORE, hb_cluster_job_set_expire_and_reorder(), hb_cluster_send_heartbeat_resp(), hb_is_heartbeat_valid(), HB_JOB_TIMER_IMMEDIATELY, HB_NSTATE_MASTER, HB_NSTATE_MAX, hb_remove_ui_node(), hb_return_node_by_name_except_me(), hb_return_ui_node(), HB_VALID_NO_ERROR, hb_valid_result_string(), HBP_CLUSTER_HEARTBEAT, hb_node_entry::heartbeat_gap, hb_cluster::hide_to_demote, hb_cluster::host_name, htons(), hb_node_entry::last_recv_hbtime, hb_ui_node_entry::last_recv_time, hbp_header::len, hb_cluster::lock, MASTER_ER_LOG_DEBUG, MASTER_ER_SET, ntohl(), ntohs(), NULL, or_unpack_int(), hbp_header::orig_host_name, p, pthread_mutex_lock, pthread_mutex_unlock, hbp_header::r, rv, hbp_header::seq, hb_cluster::shutdown, hb_node_entry::state, hbp_header::type, and hb_ui_node_entry::v_result.
Referenced by hb_thread_cluster_reader().
|
static |
Definition at line 2060 of file master_heartbeat.c.
References hb_remove_node(), and hb_node_entry::next.
Referenced by hb_cluster_cleanup(), and hb_reload_config().
|
static |
Definition at line 2129 of file master_heartbeat.c.
References hb_remove_ping_host(), host, and hb_ping_host_entry::next.
Referenced by hb_cluster_cleanup(), and hb_reload_config().
|
static |
Definition at line 2400 of file master_heartbeat.c.
References hb_remove_ui_node(), hb_ui_node_entry::next, and NULL.
Referenced by hb_cluster_cleanup().
|
static |
Definition at line 1520 of file master_heartbeat.c.
References are_hostnames_equal(), ARG_FILE_LINE, hb_cluster_send_heartbeat_req(), hb_node_entry::heartbeat_gap, hb_node_entry::host_name, hb_cluster::host_name, MASTER_ER_LOG_DEBUG, hb_node_entry::next, hb_cluster::nodes, and NULL.
Referenced by hb_cluster_job_calc_score(), hb_cluster_job_check_ping(), hb_cluster_job_demote(), hb_cluster_job_failback(), hb_cluster_job_failover(), and hb_cluster_job_heartbeat().
|
static |
Definition at line 1576 of file master_heartbeat.c.
References ARG_FILE_LINE, ER_ERROR_SEVERITY, ER_FAILED, ERR_CSS_TCP_DATAGRAM_SOCKET, HB_BUFFER_SZ, hb_set_net_header(), HBP_CLUSTER_HEARTBEAT, INVALID_SOCKET, MASTER_ER_LOG_DEBUG, MASTER_ER_SET, NO_ERROR, OR_INT_SIZE, or_pack_int(), p, hb_cluster::sfd, and hb_cluster::state.
Referenced by hb_cluster_send_heartbeat_req(), and hb_cluster_send_heartbeat_resp().
|
static |
Definition at line 1551 of file master_heartbeat.c.
References ARG_FILE_LINE, hb_cluster_send_heartbeat_internal(), hb_hostname_n_port_to_sockaddr(), MASTER_ER_LOG_DEBUG, NO_ERROR, prm_get_integer_value(), and PRM_ID_HA_PORT_ID.
Referenced by hb_cluster_cleanup(), and hb_cluster_request_heartbeat_to_all().
|
static |
Definition at line 1570 of file master_heartbeat.c.
References hb_cluster_send_heartbeat_internal().
Referenced by hb_cluster_receive_heartbeat().
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().
|
static |
Definition at line 415 of file master_heartbeat.c.
References NULL.
Referenced by hb_job_dequeue(), hb_job_queue(), and hb_job_set_expire_and_reorder().
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().
|
static |
Definition at line 5970 of file master_heartbeat.c.
References ARG_FILE_LINE, HB_PROC_ENTRY::args, hb_resource_job_arg::args, HB_PROC_ENTRY::dtime, ER_ERROR_SEVERITY, ER_HB_COMMAND_EXECUTION, ER_OUT_OF_VIRTUAL_MEMORY, hb_resource_job_arg::ftime, HB_CMD_DEREGISTER_STR, HB_PSTATE_DEAD, HB_PSTATE_DEREGISTERED, HB_PSTATE_MAX, HB_RESULT_FAILURE_STR, MASTER_ER_SET, hb_resource_job_arg::max_retries, NULL, HB_PROC_ENTRY::pid, hb_resource_job_arg::pid, prm_get_integer_value(), PRM_ID_HA_MAX_PROCESS_DEREG_CONFIRM, hb_job_arg::resource_job_arg, hb_resource_job_arg::retries, and HB_PROC_ENTRY::state.
Referenced by hb_deregister_by_args(), hb_deregister_by_pid(), and hb_reload_config().
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().
|
static |
Definition at line 6521 of file master_heartbeat.c.
References hb_job_entry::arg, hb_job_entry::expire, hb_job_entry::func, hb_job::jobs, hb_job::lock, hb_job_entry::next, p, pthread_mutex_lock, pthread_mutex_unlock, rv, and hb_job_entry::type.
|
static |
Definition at line 6425 of file master_heartbeat.c.
References hb_cluster::group_id, hb_node_state_string(), hb_node_entry::heartbeat_gap, hb_node_entry::host_name, hb_cluster::host_name, hb_node_entry::next, hb_cluster::nodes, p, hb_node_entry::priority, hb_node_entry::score, hb_node_entry::state, and hb_cluster::state.
Referenced by hb_cluster_job_calc_score(), hb_cluster_job_demote(), hb_cluster_job_failback(), and hb_cluster_job_failover().
|
static |
Definition at line 6383 of file master_heartbeat.c.
References hb_ping_result_string(), hb_ping_host_entry::host_name, hb_cluster::is_ping_check_enabled, hb_ping_host_entry::next, p, hb_cluster::ping_hosts, and hb_ping_host_entry::ping_result.
Referenced by hb_cluster_job_calc_score(), hb_cluster_job_demote(), hb_cluster_job_failback(), and hb_cluster_job_failover().
|
static |
Definition at line 6471 of file master_heartbeat.c.
References HB_PROC_ENTRY::args, HB_PROC_ENTRY::exec_path, hb_node_state_string(), hb_process_state_string(), hb_process_type_string(), HB_PSTATE_UNKNOWN, HB_PROC_ENTRY::next, p, HB_PROC_ENTRY::pid, hb_resource::procs, HB_PROC_ENTRY::sfd, hb_cluster::state, HB_PROC_ENTRY::state, and HB_PROC_ENTRY::type.
Referenced by hb_resource_job_change_mode(), and hb_resource_job_confirm_start().
|
static |
Definition at line 1896 of file master_heartbeat.c.
References error(), hb_hostname_to_sin_addr(), htons(), INVALID_SOCKET, and NO_ERROR.
Referenced by hb_cluster_send_heartbeat_req().
|
static |
Definition at line 1814 of file master_heartbeat.c.
References ARG_FILE_LINE, ER_ERROR_SEVERITY, ERR_CSS_TCP_HOST_NAME_ERROR, gethostbyname_lock, INADDR_NONE, MASTER_ER_SET_WITH_OSERROR, NO_ERROR, NULL, pthread_mutex_lock, and pthread_mutex_unlock.
Referenced by hb_check_request_eligibility(), hb_hostname_n_port_to_sockaddr(), and hb_is_heartbeat_valid().
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().
|
static |
Definition at line 2224 of file master_heartbeat.c.
References error(), hb_cluster::group_id, hb_hostname_to_sin_addr(), hb_return_node_by_name_except_me(), HB_VALID_CANNOT_RESOLVE_HOST, HB_VALID_GROUP_NAME_MISMATCH, HB_VALID_IP_ADDR_MISMATCH, HB_VALID_NO_ERROR, HB_VALID_UNIDENTIFIED_NODE, NO_ERROR, and NULL.
Referenced by hb_cluster_receive_heartbeat().
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().
|
static |
Definition at line 550 of file master_heartbeat.c.
References hb_compare_timeval(), hb_list_remove(), hb_job::jobs, hb_job::lock, NULL, pthread_mutex_lock, pthread_mutex_unlock, rv, and hb_job::shutdown.
Referenced by hb_cluster_job_dequeue(), and hb_resource_job_dequeue().
|
static |
Definition at line 499 of file master_heartbeat.c.
References hb_job_entry::arg, ARG_FILE_LINE, ER_ERROR_SEVERITY, ER_OUT_OF_VIRTUAL_MEMORY, hb_job_entry::expire, hb_job_entry::func, hb_add_timeval(), hb_compare_timeval(), hb_list_add(), hb_job::job_funcs, hb_job::jobs, hb_job::lock, MASTER_ER_SET, hb_job_entry::next, NO_ERROR, NULL, hb_job_entry::prev, pthread_mutex_lock, pthread_mutex_unlock, rv, and hb_job_entry::type.
Referenced by hb_cluster_job_queue(), and hb_resource_job_queue().
|
static |
Definition at line 596 of file master_heartbeat.c.
References hb_job_entry::expire, hb_add_timeval(), hb_compare_timeval(), hb_list_add(), hb_list_remove(), hb_job::jobs, hb_job::lock, NULL, pthread_mutex_lock, pthread_mutex_unlock, and hb_job::shutdown.
Referenced by hb_cluster_job_set_expire_and_reorder(), and hb_resource_job_set_expire_and_reorder().
|
static |
Definition at line 661 of file master_heartbeat.c.
References free_and_init, hb_list_remove(), hb_job::jobs, hb_job::lock, hb_job_entry::next, pthread_mutex_lock, pthread_mutex_unlock, rv, and hb_job::shutdown.
Referenced by hb_cluster_job_shutdown(), and hb_resource_job_shutdown().
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().
|
static |
Definition at line 5771 of file master_heartbeat.c.
References cubregex::count(), error(), i, and SLEEP_MILISEC.
Referenced by hb_cluster_job_failback().
Definition at line 333 of file master_heartbeat.c.
References hb_list::next, p, and hb_list::prev.
Referenced by hb_add_node_to_cluster(), hb_add_ping_host(), hb_add_ui_node(), hb_alloc_new_proc(), hb_job_queue(), and hb_job_set_expire_and_reorder().
Definition at line 371 of file master_heartbeat.c.
References NULL, and hb_list::prev.
Referenced by hb_reload_config().
|
static |
Definition at line 350 of file master_heartbeat.c.
References if(), hb_list::next, NULL, and hb_list::prev.
Referenced by hb_job_dequeue(), hb_job_set_expire_and_reorder(), hb_job_shutdown(), hb_remove_node(), hb_remove_ping_host(), hb_remove_proc(), and hb_remove_ui_node().
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().
|
static |
Referenced by hb_get_node_info_string(), hb_get_process_info_string(), hb_help_sprint_nodes_info(), and hb_help_sprint_processes_info().
|
static |
Definition at line 5183 of file master_heartbeat.c.
References HB_PING_FAILURE, HB_PING_FAILURE_STR, HB_PING_SUCCESS, HB_PING_SUCCESS_STR, HB_PING_SYS_ERR, HB_PING_SYS_ERR_STR, HB_PING_UNKNOWN, HB_PING_UNKNOWN_STR, HB_PING_USELESS_HOST, and HB_PING_USELESS_HOST_STR.
Referenced by hb_get_ping_host_info_string(), and hb_help_sprint_ping_host_info().
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().
|
static |
Definition at line 3713 of file master_heartbeat.c.
References NULL.
Referenced by hb_resource_job_proc_start().
|
static |
Definition at line 5142 of file master_heartbeat.c.
References HB_PSTATE_DEAD, HB_PSTATE_DEAD_STR, HB_PSTATE_DEREGISTERED, HB_PSTATE_DEREGISTERED_STR, HB_PSTATE_NOT_REGISTERED, HB_PSTATE_NOT_REGISTERED_STR, HB_PSTATE_REGISTERED, HB_PSTATE_REGISTERED_AND_ACTIVE, HB_PSTATE_REGISTERED_AND_ACTIVE_STR, HB_PSTATE_REGISTERED_AND_STANDBY_STR, HB_PSTATE_REGISTERED_AND_TO_BE_ACTIVE, HB_PSTATE_REGISTERED_AND_TO_BE_ACTIVE_STR, HB_PSTATE_REGISTERED_AND_TO_BE_STANDBY, HB_PSTATE_REGISTERED_AND_TO_BE_STANDBY_STR, HB_PSTATE_REGISTERED_STR, HB_PSTATE_STARTED, HB_PSTATE_STARTED_STR, HB_PSTATE_UNKNOWN, HB_PSTATE_UNKNOWN_STR, and HB_PTYPE_SERVER.
Referenced by hb_get_process_info_string(), hb_help_sprint_processes_info(), and hb_register_new_process().
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().
|
static |
Definition at line 5208 of file master_heartbeat.c.
References are_hostnames_equal(), ARG_FILE_LINE, assert, ER_ERROR_SEVERITY, ER_FAILED, ER_PRM_BAD_VALUE, error(), free_and_init, HB_CJOB_CHECK_VALID_PING_SERVER, hb_cluster_check_valid_ping_server(), hb_cluster_job_set_expire_and_reorder(), hb_cluster_load_group_and_node_list(), hb_cluster_load_ping_host_list(), hb_cluster_remove_all_nodes(), hb_cluster_remove_all_ping_hosts(), hb_deregister_process(), HB_JOB_TIMER_IMMEDIATELY, hb_list_move(), HB_PTYPE_SERVER, hb_resource_job_queue(), hb_return_node_by_name(), HB_RJOB_PROC_DEREG, hb_node_entry::heartbeat_gap, hb_node_entry::host_name, hb_node_entry::last_recv_hbtime, hb_cluster::lock, hb_resource::lock, hb_cluster::master, MASTER_ER_LOG_DEBUG, MASTER_ER_SET, hb_cluster::myself, hb_node_entry::next, HB_PROC_ENTRY::next, NO_ERROR, node_name, hb_cluster::nodes, NULL, hb_cluster::num_nodes, hb_cluster::num_ping_hosts, p, hb_cluster::ping_hosts, prm_get_name(), prm_get_string_value(), PRM_ID_HA_NODE_LIST, PRM_ID_HA_PING_HOSTS, PRM_ID_HA_REPLICA_LIST, hb_resource::procs, pthread_mutex_lock, pthread_mutex_unlock, rv, hb_node_entry::score, hb_node_entry::state, strlen, sysprm_reload_and_init(), and HB_PROC_ENTRY::type.
Referenced by hb_reconfig_heartbeat().
|
static |
Definition at line 3626 of file master_heartbeat.c.
References hb_remove_proc(), and HB_PROC_ENTRY::next.
Referenced by hb_resource_cleanup().
|
static |
Definition at line 2043 of file master_heartbeat.c.
References free_and_init, and hb_list_remove().
Referenced by hb_cluster_remove_all_nodes().
|
static |
Definition at line 2112 of file master_heartbeat.c.
References free_and_init, and hb_list_remove().
Referenced by hb_cluster_remove_all_ping_hosts().
|
static |
Definition at line 3609 of file master_heartbeat.c.
References free_and_init, and hb_list_remove().
Referenced by hb_remove_all_procs(), hb_resource_job_confirm_cleanup_all(), hb_resource_job_confirm_dereg(), and hb_resource_job_proc_dereg().
|
static |
Definition at line 2355 of file master_heartbeat.c.
References assert, free_and_init, hb_list_remove(), and hb_cluster::num_ui_nodes.
Referenced by hb_cleanup_ui_nodes(), hb_cluster_receive_heartbeat(), and hb_cluster_remove_all_ui_nodes().
|
static |
Definition at line 4170 of file master_heartbeat.c.
References ARG_FILE_LINE, HB_PROC_ENTRY::curr_eof, HB_PSTATE_REGISTERED_AND_ACTIVE, HB_PTYPE_SERVER, HB_PROC_ENTRY::is_curr_eof_received, LSA_AS_ARGS, LSA_COPY(), LSA_GT(), LSA_ISNULL(), MASTER_ER_LOG_DEBUG, HB_PROC_ENTRY::next, HB_PROC_ENTRY::pid, HB_PROC_ENTRY::prev_eof, hb_resource::procs, HB_PROC_ENTRY::server_hang, HB_PROC_ENTRY::state, and HB_PROC_ENTRY::type.
Referenced by hb_thread_check_disk_failure().
|
static |
Definition at line 5034 of file master_heartbeat.c.
References HB_PROC_ENTRY::conn, HB_NSTATE_UNKNOWN, hb_remove_all_procs(), hb_resource_shutdown_all_ha_procs(), hb_resource::lock, HB_PROC_ENTRY::next, NULL, hb_resource::num_procs, HB_PROC_ENTRY::pid, hb_resource::procs, pthread_mutex_lock, pthread_mutex_unlock, hb_resource::shutdown, and hb_resource::state.
Referenced by hb_master_init(), and hb_resource_shutdown_and_cleanup().
|
static |
Definition at line 3011 of file master_heartbeat.c.
References assert, HB_PSTATE_REGISTERED_AND_ACTIVE, HB_PSTATE_REGISTERED_AND_TO_BE_ACTIVE, HB_PTYPE_SERVER, HB_PROC_ENTRY::next, hb_resource::procs, HB_PROC_ENTRY::server_hang, HB_PROC_ENTRY::state, and HB_PROC_ENTRY::type.
Referenced by hb_resource_job_demote_confirm_shutdown().
|
static |
Definition at line 3039 of file master_heartbeat.c.
References ARG_FILE_LINE, HB_PROC_ENTRY::args, assert, ER_ERROR_SEVERITY, ER_HB_PROCESS_EVENT, HB_PSTATE_REGISTERED_AND_ACTIVE, HB_PSTATE_REGISTERED_AND_TO_BE_ACTIVE, HB_PTYPE_SERVER, MASTER_ER_SET, HB_PROC_ENTRY::next, HB_PROC_ENTRY::pid, hb_resource::procs, HB_PROC_ENTRY::state, and HB_PROC_ENTRY::type.
Referenced by hb_resource_job_demote_confirm_shutdown().
|
static |
Definition at line 2962 of file master_heartbeat.c.
References assert, assert_release, HB_PROC_ENTRY::being_shutdown, HB_PROC_ENTRY::conn, css_Master_socket_anchor, css_process_start_shutdown(), css_return_entry_by_conn(), HB_PSTATE_REGISTERED_AND_ACTIVE, HB_PSTATE_REGISTERED_AND_TO_BE_ACTIVE, HB_PTYPE_SERVER, MASTER_MSG_SERVER_STATUS, MASTER_TO_SRV_MSG_SIZE, MSGCAT_CATALOG_UTILS, msgcat_message(), MSGCAT_UTIL_SET_MASTER, socket_queue_entry::name, HB_PROC_ENTRY::next, NULL, HB_PROC_ENTRY::pid, hb_resource::procs, HB_PROC_ENTRY::server_hang, HB_PROC_ENTRY::state, and HB_PROC_ENTRY::type.
Referenced by hb_resource_job_demote_start_shutdown().
|
static |
Definition at line 4705 of file master_heartbeat.c.
References ARG_FILE_LINE, ER_ERROR_SEVERITY, ER_OUT_OF_VIRTUAL_MEMORY, HB_NSTATE_SLAVE, hb_resource::lock, MASTER_ER_SET, NO_ERROR, NULL, hb_resource::num_procs, hb_resource::procs, pthread_mutex_init, pthread_mutex_lock, pthread_mutex_unlock, rv, hb_resource::shutdown, and hb_resource::state.
Referenced by hb_master_init().
|
static |
Definition at line 3443 of file master_heartbeat.c.
References ARG_FILE_LINE, assert, css_Master_socket_anchor_lock, error(), free_and_init, hb_help_sprint_processes_info(), HB_INFO_STR_MAX, HB_NSTATE_MASTER, HB_NSTATE_TO_BE_SLAVE, 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_PTYPE_SERVER, hb_resource_job_queue(), hb_resource_send_changemode(), HB_RJOB_CHANGE_MODE, hb_resource::lock, MASTER_ER_LOG_DEBUG, HB_PROC_ENTRY::next, NO_ERROR, NULL, HB_PROC_ENTRY::pid, prm_get_integer_value(), PRM_ID_HA_CHANGEMODE_INTERVAL_IN_MSECS, hb_resource::procs, pthread_mutex_lock, pthread_mutex_unlock, rv, HB_PROC_ENTRY::state, hb_resource::state, and HB_PROC_ENTRY::type.
|
static |
Definition at line 2658 of file master_heartbeat.c.
References ARG_FILE_LINE, assert, HB_PROC_ENTRY::conn, css_Master_socket_anchor_lock, ER_ERROR_SEVERITY, ER_OUT_OF_VIRTUAL_MEMORY, error(), free_and_init, hb_resource_job_arg::ftime, hb_Deactivate_immediately, HB_JOB_TIMER_WAIT_500_MILLISECOND, HB_PTYPE_SERVER, hb_resource_job_queue(), hb_resource_shutdown_all_ha_procs(), HB_RJOB_CONFIRM_CLEANUP_ALL, i, hb_resource::lock, MASTER_ER_SET, hb_resource_job_arg::max_retries, HB_PROC_ENTRY::next, NO_ERROR, NULL, hb_resource::num_procs, HB_PROC_ENTRY::pid, prm_get_integer_value(), PRM_ID_HA_MAX_PROCESS_DEREG_CONFIRM, hb_resource::procs, pthread_mutex_lock, pthread_mutex_unlock, hb_job_arg::resource_job_arg, hb_resource_job_arg::retries, rv, hb_deactivate_info::server_count, hb_deactivate_info::server_pid_list, and HB_PROC_ENTRY::type.
|
static |
Definition at line 2525 of file master_heartbeat.c.
References ARG_FILE_LINE, HB_PROC_ENTRY::args, assert, HB_PROC_ENTRY::conn, ER_ERROR_SEVERITY, ER_HB_PROCESS_EVENT, ER_NOTIFICATION_SEVERITY, error(), free_and_init, hb_Deactivate_immediately, HB_PSTATE_DEREGISTERED, HB_PTYPE_SERVER, hb_remove_proc(), hb_resource_job_queue(), HB_RJOB_CONFIRM_CLEANUP_ALL, hb_resource::lock, MASTER_ER_LOG_DEBUG, MASTER_ER_SET, hb_resource_job_arg::max_retries, HB_PROC_ENTRY::next, NO_ERROR, NULL, hb_resource::num_procs, HB_PROC_ENTRY::pid, prm_get_integer_value(), PRM_ID_HA_PROCESS_DEREG_CONFIRM_INTERVAL_IN_MSECS, hb_resource::procs, pthread_mutex_lock, pthread_mutex_unlock, hb_job_arg::resource_job_arg, hb_resource_job_arg::retries, rv, HB_PROC_ENTRY::state, and HB_PROC_ENTRY::type.
|
static |
Definition at line 3354 of file master_heartbeat.c.
References ARG_FILE_LINE, hb_resource_job_arg::args, assert, error(), free_and_init, HB_PSTATE_DEREGISTERED, hb_remove_proc(), hb_resource_job_queue(), hb_return_proc_by_pid(), HB_RJOB_CONFIRM_DEREG, hb_resource::lock, MASTER_ER_LOG_DEBUG, hb_resource_job_arg::max_retries, NO_ERROR, NULL, hb_resource::num_procs, HB_PROC_ENTRY::pid, hb_resource_job_arg::pid, prm_get_integer_value(), PRM_ID_HA_PROCESS_DEREG_CONFIRM_INTERVAL_IN_MSECS, pthread_mutex_lock, pthread_mutex_unlock, hb_job_arg::resource_job_arg, hb_resource_job_arg::retries, rv, and HB_PROC_ENTRY::state.
|
static |
Definition at line 3207 of file master_heartbeat.c.
References ARG_FILE_LINE, HB_PROC_ENTRY::args, hb_resource_job_arg::args, assert, ER_ERROR_SEVERITY, ER_HB_PROCESS_EVENT, error(), free_and_init, hb_help_sprint_processes_info(), HB_INFO_STR_MAX, HB_JOB_TIMER_IMMEDIATELY, HB_JOB_TIMER_WAIT_A_SECOND, HB_NSTATE_MASTER, HB_NSTATE_SLAVE, HB_PSTATE_DEREGISTERED, HB_PSTATE_NOT_REGISTERED, HB_PSTATE_REGISTERED, HB_PSTATE_REGISTERED_AND_STANDBY, HB_PTYPE_SERVER, hb_resource_job_queue(), hb_return_proc_by_args(), HB_RJOB_CONFIRM_START, HB_RJOB_DEMOTE_START_SHUTDOWN, HB_RJOB_PROC_START, hb_cluster::is_isolated, hb_resource::lock, MASTER_ER_LOG_DEBUG, MASTER_ER_SET, hb_resource_job_arg::max_retries, NO_ERROR, NULL, HB_PROC_ENTRY::pid, prm_get_integer_value(), PRM_ID_HA_PROCESS_START_CONFIRM_INTERVAL_IN_MSECS, pthread_mutex_lock, pthread_mutex_unlock, hb_job_arg::resource_job_arg, hb_resource_job_arg::retries, rv, HB_PROC_ENTRY::state, hb_resource::state, and HB_PROC_ENTRY::type.
|
static |
Definition at line 3071 of file master_heartbeat.c.
References ARG_FILE_LINE, assert, hb_job_arg::cluster_job_arg, css_master_cleanup(), ER_ERROR_SEVERITY, ER_OUT_OF_VIRTUAL_MEMORY, error(), free_and_init, HB_CJOB_DEMOTE, hb_cluster_job_queue(), HB_JOB_TIMER_IMMEDIATELY, hb_resource_demote_confirm_shutdown_server_proc(), hb_resource_demote_kill_server_proc(), hb_resource_job_queue(), HB_RJOB_DEMOTE_CONFIRM_SHUTDOWN, hb_resource::lock, MASTER_ER_LOG_DEBUG, MASTER_ER_SET, hb_resource_job_arg::max_retries, NO_ERROR, NULL, hb_cluster_job_arg::ping_check_count, prm_get_integer_value(), PRM_ID_HA_PROCESS_DEREG_CONFIRM_INTERVAL_IN_MSECS, pthread_mutex_lock, pthread_mutex_unlock, hb_job_arg::resource_job_arg, hb_cluster_job_arg::retries, hb_resource_job_arg::retries, and rv.
|
static |
Definition at line 3149 of file master_heartbeat.c.
References ARG_FILE_LINE, assert, css_master_cleanup(), css_Master_socket_anchor_lock, ER_ERROR_SEVERITY, ER_OUT_OF_VIRTUAL_MEMORY, error(), free_and_init, hb_resource_job_arg::ftime, hb_resource_demote_start_shutdown_server_proc(), hb_resource_job_queue(), HB_RJOB_DEMOTE_CONFIRM_SHUTDOWN, hb_resource::lock, MASTER_ER_SET, hb_resource_job_arg::max_retries, NO_ERROR, NULL, prm_get_integer_value(), PRM_ID_HA_MAX_PROCESS_DEREG_CONFIRM, PRM_ID_HA_PROCESS_DEREG_CONFIRM_INTERVAL_IN_MSECS, pthread_mutex_lock, pthread_mutex_unlock, hb_job_arg::resource_job_arg, hb_resource_job_arg::retries, and rv.
|
static |
Definition at line 3510 of file master_heartbeat.c.
References hb_job_dequeue().
Referenced by hb_thread_resource_worker().
|
static |
Definition at line 4737 of file master_heartbeat.c.
References ARG_FILE_LINE, assert, ER_ERROR_SEVERITY, ER_FAILED, ER_OUT_OF_VIRTUAL_MEMORY, error(), hb_resource_job_queue(), hb_resource_jobs, HB_RJOB_CHANGE_MODE, hb_job::job_funcs, hb_job::jobs, hb_job::lock, MASTER_ER_SET, NO_ERROR, NULL, hb_job::num_jobs, prm_get_integer_value(), PRM_ID_HA_FAILOVER_WAIT_TIME_IN_MSECS, PRM_ID_HA_INIT_TIMER_IN_MSECS, pthread_mutex_init, pthread_mutex_lock, pthread_mutex_unlock, rv, and hb_job::shutdown.
Referenced by hb_master_init().
|
static |
Definition at line 2858 of file master_heartbeat.c.
References ARG_FILE_LINE, assert, assert_release, HB_PROC_ENTRY::conn, css_Master_socket_anchor, css_Master_socket_anchor_lock, css_process_start_shutdown(), css_return_entry_by_conn(), error(), free_and_init, HB_PSTATE_DEREGISTERED, HB_PTYPE_SERVER, hb_remove_proc(), hb_resource_job_queue(), hb_return_proc_by_pid(), HB_RJOB_CONFIRM_DEREG, hb_resource::lock, MASTER_ER_LOG_DEBUG, MASTER_MSG_SERVER_STATUS, MASTER_TO_SRV_MSG_SIZE, MSGCAT_CATALOG_UTILS, msgcat_message(), MSGCAT_UTIL_SET_MASTER, socket_queue_entry::name, NO_ERROR, NULL, hb_resource::num_procs, HB_PROC_ENTRY::pid, hb_resource_job_arg::pid, prm_get_integer_value(), PRM_ID_HA_PROCESS_DEREG_CONFIRM_INTERVAL_IN_MSECS, pthread_mutex_lock, pthread_mutex_unlock, hb_job_arg::resource_job_arg, rv, HB_PROC_ENTRY::state, and HB_PROC_ENTRY::type.
|
static |
Definition at line 2726 of file master_heartbeat.c.
References ARG_FILE_LINE, hb_resource_job_arg::args, argv, assert, css_master_cleanup(), ER_ERROR_SEVERITY, ER_HB_PROCESS_EVENT, ER_WARNING_SEVERITY, ERR_CSS_CANNOT_FORK, error(), free_and_init, HB_GET_ELAPSED_TIME, HB_JOB_TIMER_WAIT_A_SECOND, HB_MAX_NUM_PROC_ARGV, hb_proc_make_arg(), HB_PROC_RECOVERY_DELAY_TIME, HB_PSTATE_DEREGISTERED, HB_PSTATE_STARTED, hb_resource_job_queue(), hb_return_proc_by_args(), HB_RJOB_CONFIRM_START, HB_RJOB_PROC_START, hb_resource::lock, MASTER_ER_LOG_DEBUG, MASTER_ER_SET, NO_ERROR, NULL, hb_resource_job_arg::pid, pid, prm_get_integer_value(), PRM_ID_HA_PROCESS_START_CONFIRM_INTERVAL_IN_MSECS, pthread_mutex_lock, pthread_mutex_unlock, hb_job_arg::resource_job_arg, rv, and strdup().
|
static |
Definition at line 3524 of file master_heartbeat.c.
References ARG_FILE_LINE, ER_FAILED, hb_job_queue(), HB_RJOB_MAX, and MASTER_ER_LOG_DEBUG.
Referenced by hb_cleanup_conn_and_start_process(), hb_deregister_by_args(), hb_deregister_by_pid(), hb_prepare_deactivate_heartbeat(), hb_reload_config(), hb_resource_job_change_mode(), hb_resource_job_cleanup_all(), hb_resource_job_confirm_cleanup_all(), hb_resource_job_confirm_dereg(), hb_resource_job_confirm_start(), hb_resource_job_demote_confirm_shutdown(), hb_resource_job_demote_start_shutdown(), hb_resource_job_initialize(), hb_resource_job_proc_dereg(), hb_resource_job_proc_start(), and hb_thread_check_disk_failure().
|
static |
Definition at line 3543 of file master_heartbeat.c.
References ARG_FILE_LINE, ER_FAILED, hb_job_set_expire_and_reorder(), HB_RJOB_MAX, MASTER_ER_LOG_DEBUG, and NO_ERROR.
Referenced by hb_cluster_job_failover().
|
static |
Definition at line 3562 of file master_heartbeat.c.
References hb_job_shutdown().
Referenced by hb_master_init(), and hb_resource_shutdown_and_cleanup().
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().
|
static |
Definition at line 4008 of file master_heartbeat.c.
References ARG_FILE_LINE, HB_PROC_ENTRY::args, assert, HB_PROC_ENTRY::changemode_gap, HB_PROC_ENTRY::conn, css_ha_server_state_string(), css_send_heartbeat_data(), css_send_heartbeat_request(), ER_ERROR_SEVERITY, ER_FAILED, ER_HA_GENERIC_ERROR, ER_HB_PROCESS_EVENT, error(), HA_SERVER_STATE_ACTIVE, HA_SERVER_STATE_STANDBY, HB_MAX_CHANGEMODE_DIFF_TO_KILL, HB_MAX_CHANGEMODE_DIFF_TO_TERM, HB_NSTATE_MASTER, HB_NSTATE_SLAVE, HB_NSTATE_TO_BE_SLAVE, htonl(), MASTER_ER_SET, NO_ERROR, NO_ERRORS, NULL, HB_PROC_ENTRY::pid, SERVER_CHANGE_HA_MODE, and hb_resource::state.
Referenced by hb_resource_job_change_mode().
|
static |
Definition at line 4229 of file master_heartbeat.c.
References HB_PROC_ENTRY::conn, css_send_heartbeat_request(), HB_NSTATE_MASTER, HB_PSTATE_REGISTERED_AND_ACTIVE, HB_PROC_ENTRY::is_curr_eof_received, HB_PROC_ENTRY::next, hb_resource::procs, SERVER_GET_EOF, HB_PROC_ENTRY::state, and hb_resource::state.
Referenced by hb_thread_check_disk_failure().
|
static |
Definition at line 4976 of file master_heartbeat.c.
References ARG_FILE_LINE, assert_release, HB_PROC_ENTRY::conn, css_Master_socket_anchor, css_process_start_shutdown(), css_remove_entry_by_conn(), css_return_entry_by_conn(), HB_PSTATE_DEREGISTERED, HB_PTYPE_SERVER, INVALID_SOCKET, MASTER_ER_LOG_DEBUG, MASTER_MSG_SERVER_STATUS, MASTER_TO_SRV_MSG_SIZE, MSGCAT_CATALOG_UTILS, msgcat_message(), MSGCAT_UTIL_SET_MASTER, socket_queue_entry::name, HB_PROC_ENTRY::next, NULL, HB_PROC_ENTRY::pid, hb_resource::procs, HB_PROC_ENTRY::sfd, HB_PROC_ENTRY::state, and HB_PROC_ENTRY::type.
Referenced by hb_resource_cleanup(), and hb_resource_job_cleanup_all().
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().
|
static |
Definition at line 2182 of file master_heartbeat.c.
References are_hostnames_equal(), hb_node_entry::host_name, hb_node_entry::next, hb_cluster::nodes, and NULL.
Referenced by hb_reload_config().
|
static |
Definition at line 2206 of file master_heartbeat.c.
References are_hostnames_equal(), hb_node_entry::host_name, hb_cluster::host_name, hb_node_entry::next, hb_cluster::nodes, and NULL.
Referenced by hb_cluster_receive_heartbeat(), and hb_is_heartbeat_valid().
|
static |
Definition at line 3644 of file master_heartbeat.c.
References HB_PROC_ENTRY::args, HB_PROC_ENTRY::next, NULL, and hb_resource::procs.
Referenced by hb_deregister_by_args(), hb_is_registered_process(), hb_register_new_process(), hb_resource_job_confirm_start(), hb_resource_job_proc_start(), and hb_start_util_process().
|
static |
Definition at line 3689 of file master_heartbeat.c.
References HB_PROC_ENTRY::next, NULL, hb_resource::procs, and HB_PROC_ENTRY::sfd.
Referenced by hb_cleanup_conn_and_start_process(), hb_is_hang_process(), hb_resource_receive_changemode(), hb_resource_receive_get_eof(), and hb_return_proc_state_by_fd().
|
static |
Definition at line 3666 of file master_heartbeat.c.
References HB_PROC_ENTRY::next, NULL, HB_PROC_ENTRY::pid, and hb_resource::procs.
Referenced by hb_deregister_by_pid(), hb_resource_job_confirm_dereg(), and hb_resource_job_proc_dereg().
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().
|
static |
Definition at line 2286 of file master_heartbeat.c.
References are_hostnames_equal(), hb_ui_node_entry::group_id, hb_ui_node_entry::host_name, hb_ui_node_entry::next, NULL, hb_ui_node_entry::saddr, and hb_cluster::ui_nodes.
Referenced by hb_add_ui_node(), and hb_cluster_receive_heartbeat().
|
static |
Definition at line 1786 of file master_heartbeat.c.
References hbp_header::dest_host_name, ER_FAILED, hbp_header::group_id, hb_cluster::group_id, hb_node_entry::host_name, htonl(), htons(), hbp_header::len, hb_cluster::myself, NO_ERROR, NULL, hbp_header::orig_host_name, hbp_header::r, hbp_header::seq, strncpy_bufsize, and hbp_header::type.
Referenced by hb_cluster_send_heartbeat_internal().
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().
|
static |
Definition at line 464 of file master_heartbeat.c.
References NULL.
Referenced by hb_disable_er_log(), and hb_get_process_info_string().
|
static |
Definition at line 4466 of file master_heartbeat.c.
References ARG_FILE_LINE, assert, css_Master_socket_anchor_lock, error(), hb_disable_er_log(), HB_DISK_FAILURE_CHECK_TIMER_IN_MSECS, HB_JOB_TIMER_IMMEDIATELY, HB_NOLOG_DEMOTE_ON_DISK_FAIL, HB_NSTATE_MASTER, HB_NSTATE_SLAVE, hb_resource_check_server_log_grow(), hb_resource_job_queue(), hb_resource_send_get_eof(), HB_RJOB_DEMOTE_START_SHUTDOWN, hb_cluster::is_isolated, hb_cluster::lock, hb_resource::lock, MASTER_ER_LOG_DEBUG, NO_ERROR, NULL, prm_get_integer_value(), PRM_ID_HA_CHECK_DISK_FAILURE_INTERVAL_IN_SECS, pthread_mutex_lock, pthread_mutex_unlock, rv, hb_resource::shutdown, SLEEP_MILISEC, and hb_resource::state.
Referenced by hb_thread_initialize(), and hb_thread_resource_worker().
|
static |
Definition at line 4356 of file master_heartbeat.c.
References ARG_FILE_LINE, error(), HB_BUFFER_SZ, hb_cluster_receive_heartbeat(), hb_thread_resource_worker(), MASTER_ER_LOG_DEBUG, MAX_ALIGNMENT, NULL, PTR_ALIGN, hb_cluster::sfd, and hb_cluster::shutdown.
Referenced by hb_thread_cluster_worker(), and hb_thread_initialize().
|
static |
Definition at line 4311 of file master_heartbeat.c.
References hb_job_entry::arg, ARG_FILE_LINE, free_and_init, hb_job_entry::func, hb_cluster_job_dequeue(), hb_thread_cluster_reader(), MASTER_ER_LOG_DEBUG, NULL, hb_job::shutdown, and SLEEP_MILISEC.
Referenced by hb_resource_receive_get_eof(), and hb_thread_initialize().
|
static |
Definition at line 4779 of file master_heartbeat.c.
References ARG_FILE_LINE, ER_CSS_PTHREAD_ATTR_DESTROY, ER_CSS_PTHREAD_ATTR_INIT, ER_CSS_PTHREAD_ATTR_SETDETACHSTATE, ER_CSS_PTHREAD_ATTR_SETSCOPE, ER_CSS_PTHREAD_ATTR_SETSTACKSIZE, ER_CSS_PTHREAD_CREATE, ER_ERROR_SEVERITY, hb_thread_check_disk_failure(), hb_thread_cluster_reader(), hb_thread_cluster_worker(), hb_thread_resource_worker(), MASTER_ER_SET_WITH_OSERROR, NO_ERROR, NULL, prm_get_bigint_value(), prm_get_bool_value(), PRM_ID_PTHREAD_SCOPE_PROCESS, PRM_ID_THREAD_STACKSIZE, and rv.
Referenced by hb_master_init().
|
static |
Definition at line 4421 of file master_heartbeat.c.
References hb_job_entry::arg, ARG_FILE_LINE, free_and_init, hb_job_entry::func, hb_resource_job_dequeue(), hb_thread_check_disk_failure(), MASTER_ER_LOG_DEBUG, NULL, hb_job::shutdown, and SLEEP_MILISEC.
Referenced by hb_thread_cluster_reader(), and hb_thread_initialize().
|
static |
Definition at line 2261 of file master_heartbeat.c.
References assert, HB_VALID_CANNOT_RESOLVE_HOST, HB_VALID_CANNOT_RESOLVE_HOST_STR, HB_VALID_GROUP_NAME_MISMATCH, HB_VALID_GROUP_NAME_MISMATCH_STR, HB_VALID_IP_ADDR_MISMATCH, HB_VALID_IP_ADDR_MISMATCH_STR, HB_VALID_NO_ERROR, HB_VALID_NO_ERROR_STR, HB_VALID_UNIDENTIFIED_NODE, and HB_VALID_UNIDENTIFIED_NODE_STR.
Referenced by hb_cluster_receive_heartbeat(), and hb_get_node_info_string().
Definition at line 242 of file master_heartbeat.c.
Referenced by css_process_kill_master().
HB_CLUSTER* hb_Cluster = NULL |
Definition at line 240 of file master_heartbeat.c.
Referenced by css_process_kill_master().
|
static |
Definition at line 253 of file master_heartbeat.c.
Referenced by hb_cluster_job_initialize().
bool hb_Deactivate_immediately = false |
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().
|
static |
Definition at line 248 of file master_heartbeat.c.
|
static |
Definition at line 250 of file master_heartbeat.c.
Referenced by hb_activate_heartbeat(), and hb_deactivate_heartbeat().
|
static |
Definition at line 246 of file master_heartbeat.c.
Referenced by hb_disable_er_log(), hb_enable_er_log(), and hb_get_admin_info_string().
HB_RESOURCE* hb_Resource = NULL |
Definition at line 241 of file master_heartbeat.c.
Referenced by css_process_kill_master().
|
static |
Definition at line 266 of file master_heartbeat.c.
Referenced by hb_resource_job_initialize().
Definition at line 243 of file master_heartbeat.c.
Referenced by css_process_kill_master().