CUBRID Engine
latest
|
#include "server_support.h"
#include "config.h"
#include "load_worker_manager.hpp"
#include "log_append.hpp"
#include "session.h"
#include "thread_entry_task.hpp"
#include "thread_entry.hpp"
#include "thread_manager.hpp"
#include "thread_worker_pool.hpp"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <signal.h>
#include <unistd.h>
#include <sys/socket.h>
#include <fcntl.h>
#include <netinet/in.h>
#include <assert.h>
#include "porting.h"
#include "memory_alloc.h"
#include "boot_sr.h"
#include "connection_defs.h"
#include "connection_globals.h"
#include "release_string.h"
#include "system_parameter.h"
#include "environment_variable.h"
#include "error_manager.h"
#include "connection_error.h"
#include "message_catalog.h"
#include "critical_section.h"
#include "lock_manager.h"
#include "log_lsa.hpp"
#include "log_manager.h"
#include "network.h"
#include "object_representation.h"
#include "jsp_sr.h"
#include "show_scan.h"
#include "tcp.h"
#include "connection_sr.h"
#include "xserver_interface.h"
#include "utility.h"
#include "vacuum.h"
#include "heartbeat.h"
#include "dbtype.h"
Go to the source code of this file.
Classes | |
struct | ha_log_applier_state_table |
class | css_server_task |
class | css_server_external_task |
class | css_connection_task |
Macros | |
#define | CSS_WAIT_COUNT 5 /* # of retry to connect to master */ |
#define | CSS_GOING_DOWN_IMMEDIATELY "Server going down immediately" |
#define | SockError -1 |
#define | RMUTEX_NAME_TEMP_CONN_ENTRY "TEMP_CONN_ENTRY" |
#define | HA_LOG_APPLIER_STATE_TABLE_MAX 5 |
#define | FROM_OTHERS 0 |
#define | FROM_REGISTER_CLIENT 1 |
#define | FROM_UNREGISTER_CLIENT 2 |
Typedefs | |
typedef struct ha_log_applier_state_table | HA_LOG_APPLIER_STATE_TABLE |
Variables | |
static bool | css_Server_shutdown_inited = false |
static struct timeval | css_Shutdown_timeout = { 0, 0 } |
static char * | css_Master_server_name = NULL |
static int | css_Master_port_id |
static CSS_CONN_ENTRY * | css_Master_conn |
static IP_INFO * | css_Server_accessible_ip_info |
static char * | ip_list_file_name = NULL |
static char | ip_file_real_path [PATH_MAX] |
static int(* | css_Server_request_handler )(THREAD_ENTRY *, unsigned int, int, int, char *) |
static HA_SERVER_STATE | ha_Server_state = HA_SERVER_STATE_IDLE |
static bool | ha_Repl_delay_detected = false |
static int | ha_Server_num_of_hosts = 0 |
static HA_LOG_APPLIER_STATE_TABLE | ha_Log_applier_state [HA_LOG_APPLIER_STATE_TABLE_MAX] |
static int | ha_Log_applier_state_num = 0 |
static cubthread::entry_workpool * | css_Server_request_worker_pool = NULL |
static cubthread::entry_workpool * | css_Connection_worker_pool = NULL |
static const size_t | CSS_JOB_QUEUE_SCAN_COLUMN_COUNT = 4 |
#define CSS_GOING_DOWN_IMMEDIATELY "Server going down immediately" |
Definition at line 86 of file server_support.c.
#define CSS_WAIT_COUNT 5 /* # of retry to connect to master */ |
Definition at line 85 of file server_support.c.
Referenced by css_reestablish_connection_to_master().
#define FROM_OTHERS 0 |
#define FROM_REGISTER_CLIENT 1 |
Referenced by css_check_ha_server_state_for_client().
#define FROM_UNREGISTER_CLIENT 2 |
Referenced by css_check_ha_server_state_for_client().
#define HA_LOG_APPLIER_STATE_TABLE_MAX 5 |
Definition at line 115 of file server_support.c.
Referenced by css_set_ha_num_of_hosts().
#define RMUTEX_NAME_TEMP_CONN_ENTRY "TEMP_CONN_ENTRY" |
Definition at line 94 of file server_support.c.
Referenced by css_refuse_connection_request().
#define SockError -1 |
Definition at line 91 of file server_support.c.
Referenced by css_check_conn(), and css_master_thread().
typedef struct ha_log_applier_state_table HA_LOG_APPLIER_STATE_TABLE |
Definition at line 116 of file server_support.c.
char* css_add_client_version_string | ( | THREAD_ENTRY * | thread_p, |
const char * | version_string | ||
) |
Definition at line 1878 of file server_support.c.
References ARG_FILE_LINE, assert, css_get_current_conn_entry(), ER_ERROR_SEVERITY, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), NULL, and strlen.
Referenced by server_ping_with_handshake().
bool css_are_all_request_handlers_suspended | ( | void | ) |
Definition at line 3138 of file server_support.c.
References css_is_any_thread_not_suspended_mapfunc(), cubthread::worker_pool< Context >::get_max_count(), and cubthread::worker_pool< Context >::map_running_contexts().
Referenced by lock_detect_local_deadlock().
void css_block_all_active_conn | ( | unsigned short | stop_phase | ) |
Definition at line 1140 of file server_support.c.
References assert, css_Active_conn_anchor, css_end_server_request(), css_Pipe_to_master, END_EXCLUSIVE_ACCESS_ACTIVE_CONN_ANCHOR, css_conn_entry::fd, IS_INVALID_SOCKET, logtb_set_tran_index_interrupt(), css_conn_entry::next, NO_ERROR, NULL, rmutex_lock, rmutex_unlock, and START_EXCLUSIVE_ACCESS_ACTIVE_CONN_ANCHOR.
Referenced by css_stop_all_workers().
int css_change_ha_server_state | ( | THREAD_ENTRY * | thread_p, |
HA_SERVER_STATE | state, | ||
bool | force, | ||
int | timeout, | ||
bool | heartbeat | ||
) |
Definition at line 2219 of file server_support.c.
References trantable::all_tdes, ARG_FILE_LINE, assert, boot_Host_name, BOOT_IS_ALLOWED_CLIENT_TYPE_IN_MT_MODE, BOOT_SERVER_MAINTENANCE, BOOT_SERVER_UP, log_tdes::client, clientids::client_type, csect_enter, csect_exit, CSECT_HA_SERVER_STATE, css_check_ha_log_applier_done(), css_check_ha_log_applier_working(), css_ha_server_state_string(), css_transit_ha_server_state(), ER_CSS_SERVER_HA_MODE_CHANGE, ER_ERROR_SEVERITY, ER_FAILED, er_log_debug, er_set(), clientids::get_host_name(), HA_DISABLED, ha_Server_state, HA_SERVER_STATE_ACTIVE, HA_SERVER_STATE_DEAD, HA_SERVER_STATE_IDLE, HA_SERVER_STATE_MAINTENANCE, HA_SERVER_STATE_NA, HA_SERVER_STATE_STANDBY, HA_SERVER_STATE_TO_BE_ACTIVE, HA_SERVER_STATE_TO_BE_STANDBY, i, INF_WAIT, log_append_ha_server_state(), log_Gl, log_set_ha_promotion_time(), logtb_count_clients(), logtb_count_not_allowed_clients_in_maintenance_mode(), logtb_disable_update(), logtb_enable_update(), logtb_slam_transaction(), NO_ERROR, NULL, NULL_TRANID, trantable::num_total_indices, ha_log_applier_state_table::state, thread_sleep(), TR_TABLE_CS_ENTER, TR_TABLE_CS_EXIT, log_tdes::tran_index, log_global::trantable, and log_tdes::trid.
Referenced by boot_restart_server(), css_process_change_server_ha_mode_request(), and sboot_change_ha_mode().
|
static |
Referenced by css_is_shutdown_timeout_expired(), css_notify_ha_log_applier_state(), and css_process_new_client().
|
static |
Definition at line 347 of file server_support.c.
References CONN_OPEN, ER_FAILED, css_conn_entry::fd, NO_ERROR, SockError, and css_conn_entry::status.
Referenced by css_connection_handler_thread(), and css_master_thread().
|
static |
Definition at line 2165 of file server_support.c.
References HA_LOG_APPLIER_STATE_DONE, ha_Server_num_of_hosts, ha_Server_state, HA_SERVER_STATE_ACTIVE, HA_SERVER_STATE_TO_BE_ACTIVE, i, and ha_log_applier_state_table::state.
Referenced by css_change_ha_server_state(), and css_notify_ha_log_applier_state().
|
static |
Definition at line 2189 of file server_support.c.
References HA_LOG_APPLIER_STATE_DONE, HA_LOG_APPLIER_STATE_WORKING, ha_Server_num_of_hosts, ha_Server_state, HA_SERVER_STATE_STANDBY, HA_SERVER_STATE_TO_BE_STANDBY, i, and ha_log_applier_state_table::state.
Referenced by css_change_ha_server_state(), and css_notify_ha_log_applier_state().
int css_check_ha_server_state_for_client | ( | THREAD_ENTRY * | thread_p, |
int | whence | ||
) |
Definition at line 2103 of file server_support.c.
References ARG_FILE_LINE, assert, css_transit_ha_server_state(), ER_ERROR_SEVERITY, er_log_debug, er_set(), err, ERR_CSS_ERROR_FROM_SERVER, FROM_REGISTER_CLIENT, FROM_UNREGISTER_CLIENT, ha_Server_state, HA_SERVER_STATE_STANDBY, HA_SERVER_STATE_TO_BE_ACTIVE, HA_SERVER_STATE_TO_BE_STANDBY, logtb_count_clients(), logtb_disable_update(), NO_ERROR, and ha_log_applier_state_table::state.
Referenced by xboot_register_client(), and xboot_unregister_client().
void css_cleanup_server_queues | ( | unsigned int | eid | ) |
Definition at line 1941 of file server_support.c.
References css_Conn_array, CSS_ENTRYID_FROM_EID, and css_remove_all_unexpected_packets().
Referenced by net_cleanup_server_queues().
|
static |
Definition at line 803 of file server_support.c.
References css_Pipe_to_master, css_shutdown_conn(), INVALID_SOCKET, IS_INVALID_SOCKET, and NULL.
Referenced by css_init(), and css_master_thread().
|
static |
Definition at line 982 of file server_support.c.
References ARG_FILE_LINE, assert, CHECK_CLIENT_IS_ALIVE, css_conn_entry::client_id, COMMAND_TYPE, CONN_CLOSING, CONN_OPEN, CONNECTION_CLOSED, css_check_conn(), css_count_transaction_worker_threads(), css_peer_alive(), css_push_server_task(), css_read_and_queue(), css_conn_entry::db_error, er_log_debug, ERROR_ON_READ, css_conn_entry::fd, ha_Server_state, HA_SERVER_STATE_TO_BE_STANDBY, css_conn_entry::in_transaction, NO_ERROR, NO_ERRORS, NULL, pthread_mutex_lock, pthread_mutex_unlock, REQUEST_REFUSED, rmutex_lock, rmutex_unlock, rv, css_conn_entry::status, thread_get_thread_entry_info(), and TT_SERVER.
Referenced by css_connection_task::execute().
size_t css_count_transaction_worker_threads | ( | THREAD_ENTRY * | thread_p, |
int | tran_index, | ||
int | client_id | ||
) |
Definition at line 3230 of file server_support.c.
References cubregex::count(), css_count_transaction_worker_threads_mapfunc(), and cubthread::worker_pool< Context >::map_running_contexts().
Referenced by css_connection_handler_thread(), log_abort_all_active_transaction(), net_server_conn_down(), and xtran_wait_server_active_trans().
|
static |
Definition at line 3177 of file server_support.c.
References ha_log_applier_state_table::client_id, css_conn_entry::client_id, NULL, NULL_TRAN_INDEX, pthread_mutex_lock, pthread_mutex_unlock, cubthread::entry::TS_CHECK, cubthread::entry::TS_DEAD, cubthread::entry::TS_FREE, and TT_WORKER.
Referenced by css_count_transaction_worker_threads().
void css_end_server_request | ( | CSS_CONN_ENTRY * | conn | ) |
Definition at line 1764 of file server_support.c.
References assert, CONN_CLOSING, css_remove_all_unexpected_packets(), NO_ERROR, NULL, rmutex_lock, rmutex_unlock, and css_conn_entry::status.
Referenced by css_block_all_active_conn(), net_server_conn_down(), and slogwr_get_log_pages().
|
static |
Definition at line 2896 of file server_support.c.
References css_is_log_writer(), NULL, and cubthread::entry::TS_FREE.
Referenced by css_stop_all_workers().
int css_get_client_id | ( | THREAD_ENTRY * | thread_p | ) |
Definition at line 2632 of file server_support.c.
References assert, css_conn_entry::client_id, NULL, and thread_get_thread_entry_info().
Referenced by css_notify_ha_log_applier_state().
unsigned int css_get_comm_request_id | ( | THREAD_ENTRY * | thread_p | ) |
Definition at line 2689 of file server_support.c.
References assert, NULL, and thread_get_thread_entry_info().
Referenced by xcallback_console_print(), xio_send_user_prompt_to_client(), xlog_send_log_pages_to_client(), xs_receive_data_from_client_with_timeout(), xs_send_action_to_client(), and xs_send_method_call_info_to_client().
|
static |
Definition at line 3241 of file server_support.c.
References prm_get_bool_value(), and PRM_ID_THREAD_CONNECTION_POOLING.
Referenced by css_init(), and css_start_all_threads().
|
static |
Definition at line 3247 of file server_support.c.
References prm_get_integer_value(), and PRM_ID_THREAD_CONNECTION_TIMEOUT_SECONDS.
Referenced by css_init().
CSS_CONN_ENTRY* css_get_current_conn_entry | ( | void | ) |
Definition at line 2706 of file server_support.c.
References assert, NULL, and thread_get_thread_entry_info().
Referenced by css_add_client_version_string(), fileio_write_backup_node(), and px_sort_assign().
int css_get_ha_num_of_hosts | ( | void | ) |
Definition at line 1975 of file server_support.c.
References ha_Server_num_of_hosts.
|
static |
Definition at line 510 of file server_support.c.
References css_readn(), and ntohl().
Referenced by css_process_change_server_ha_mode_request(), css_process_master_request(), and css_process_shutdown_request().
size_t css_get_num_connection_workers | ( | void | ) |
Definition at line 3031 of file server_support.c.
References cubthread::worker_pool< Context >::get_max_count().
Referenced by css_get_num_total_workers().
size_t css_get_num_request_workers | ( | void | ) |
Definition at line 3022 of file server_support.c.
References cubthread::worker_pool< Context >::get_max_count().
Referenced by css_get_num_total_workers(), and lock_victimize_first_thread_mapfunc().
size_t css_get_num_total_workers | ( | void | ) |
Definition at line 3040 of file server_support.c.
References css_get_num_connection_workers(), and css_get_num_request_workers().
|
static |
Definition at line 3255 of file server_support.c.
References prm_get_bool_value(), and PRM_ID_THREAD_WORKER_POOLING.
Referenced by css_init(), and css_start_all_threads().
|
static |
Definition at line 3261 of file server_support.c.
References prm_get_integer_value(), and PRM_ID_THREAD_WORKER_TIMEOUT_SECONDS.
Referenced by css_init().
void css_get_thread_stats | ( | UINT64 * | stats_out | ) |
Definition at line 3013 of file server_support.c.
References cubthread::worker_pool< Context >::get_stats().
Referenced by perfmon_server_calc_stats().
HA_SERVER_STATE css_ha_server_state | ( | void | ) |
Definition at line 1985 of file server_support.c.
References boot_change_ha_mode(), ha_Server_state, and HA_SERVER_STATE_NA.
Referenced by css_process_change_server_ha_mode_request().
int css_init | ( | THREAD_ENTRY * | thread_p, |
char * | server_name, | ||
int | name_length, | ||
int | port_id | ||
) |
Definition at line 1304 of file server_support.c.
References ARG_FILE_LINE, assert, cubthread::manager::create_worker_pool(), css_close_connection_to_master(), css_close_server_connection_socket(), css_connect_to_master_server(), css_get_connection_thread_pooling_configuration(), css_get_connection_thread_timeout_configuration(), css_get_max_conn(), css_get_server_request_thread_pooling_configuration(), css_get_server_request_thread_timeout_configuration(), css_insert_into_active_conn_list(), css_Master_port_id, css_Master_server_name, css_Pipe_to_master, css_Server_connection_socket, css_setup_server_loop(), css_start_shutdown_server(), css_stop_all_workers(), css_windows_shutdown(), css_windows_startup(), cubthread::manager::destroy_worker_pool(), ER_FAILED, ER_FATAL_ERROR_SEVERITY, ER_GENERIC_ERROR, cubthread::worker_pool< Context >::er_log_stats(), er_set(), css_conn_entry::fd, free_and_init, cubthread::get_manager(), HA_DISABLED, HB_PTYPE_SERVER, hb_register_to_master(), INVALID_SOCKET, cubthread::is_logging_configured(), log_prior_has_worker_log_records(), cubthread::LOG_WORKER_POOL_CONNECTIONS, cubthread::LOG_WORKER_POOL_TRAN_WORKERS, logpb_force_flush_pages(), NO_ERROR, NULL, prm_get_bool_value(), PRM_ID_STATS_ON, strdup(), cubthread::system_core_count(), thread_get_manager(), THREAD_STOP_LOGWR, THREAD_STOP_WORKERS_EXCEPT_LOGWR, vacuum_stop_workers(), and cubload::worker_manager_stop_all().
Referenced by net_server_start().
void css_initialize_server_interfaces | ( | int(*)(THREAD_ENTRY *thrd, unsigned int eid, int request, int size, char *buffer) | request_handler, |
CSS_THREAD_FN | connection_error_function | ||
) |
Definition at line 1270 of file server_support.c.
References css_internal_connection_handler(), css_register_handler_routines(), css_Server_request_handler, and NULL.
Referenced by net_server_start().
|
static |
Definition at line 1180 of file server_support.c.
References css_insert_into_active_conn_list(), cubthread::get_manager(), NO_ERRORS, and cubthread::manager::push_task().
Referenced by css_initialize_server_interfaces().
|
static |
Definition at line 1204 of file server_support.c.
References assert, css_conn_entry::client_id, CSS_NO_ERRORS, css_receive_data(), css_receive_request(), css_return_eid_from_conn(), css_Server_request_handler, css_set_thread_info(), CSS_UNPLANNED_SHUTDOWN, css_conn_entry::db_error, eid, ERROR_WHEN_READING_SIZE, NO_DATA_AVAILABLE, NO_ERRORS, NULL, pthread_mutex_unlock, and rc.
Referenced by css_server_task::execute().
|
static |
Definition at line 3122 of file server_support.c.
References cubregex::count(), and cubthread::entry::TS_WAIT.
Referenced by css_are_all_request_handlers_suspended().
bool css_is_ha_repl_delayed | ( | void | ) |
Definition at line 1991 of file server_support.c.
References ha_Repl_delay_detected.
Referenced by log_is_log_flush_daemon_available(), server_capabilities(), and xtran_lock_rep_read().
|
static |
Definition at line 2923 of file server_support.c.
References NULL, and THREAD_STOP_LOGWR.
Referenced by css_find_not_stopped(), css_stop_log_writer(), and css_stop_non_log_writer().
bool css_is_shutdown_timeout_expired | ( | void | ) |
Definition at line 818 of file server_support.c.
References ARG_FILE_LINE, ASSERT_ERROR_AND_SET, packet_header::buffer_size, COMMAND_TYPE, CONN_OPEN, CONNECTION_CLOSED, css_check_accessibility(), css_Connect_handler, css_free_conn(), css_make_conn(), css_read_header(), css_refuse_connection_request(), css_send_reply_to_new_client_request(), css_server_accept(), css_Server_connection_socket, css_Shutdown_timeout, DATA_REQUEST, DEFAULT_HEADER_DATA, ER_CSS_CLIENTS_EXCEEDED, ER_ERROR_SEVERITY, er_set(), error(), packet_header::function_code, IS_INVALID_SOCKET, NO_ERROR, NO_ERRORS, ntohl(), ntohs(), NULL, NUM_NORMAL_TRANS, prm_get_bool_value(), PRM_ID_ACCESS_IP_CONTROL, rc, packet_header::request_id, SERVER_CLIENTS_EXCEEDED, SERVER_CONNECTED, SERVER_INACCESSIBLE_IP, SERVER_NOT_FOUND, css_conn_entry::status, packet_header::type, and WRONG_PACKET_TYPE.
Referenced by css_stop_all_workers(), and log_abort_all_active_transaction().
bool css_is_shutdowning_server | ( | ) |
Definition at line 1279 of file server_support.c.
References css_Server_shutdown_inited.
Referenced by net_server_conn_down(), sbtree_load_index(), and xbtree_load_online_index().
THREAD_RET_T THREAD_CALLING_CONVENTION css_master_thread | ( | void | ) |
Definition at line 391 of file server_support.c.
References ARG_FILE_LINE, css_check_conn(), css_close_connection_to_master(), css_Pipe_to_master, css_process_master_request(), css_reestablish_connection_to_master(), css_Server_connection_socket, css_set_shutdown_timeout(), css_shutdown_conn(), ER_ERROR_SEVERITY, ER_HB_PROCESS_EVENT, er_set(), HA_DISABLED, INVALID_SOCKET, IS_INVALID_SOCKET, NULL, prm_get_integer_value(), PRM_ID_SHUTDOWN_WAIT_TIME_IN_SECS, PRM_ID_TCP_CONNECTION_TIMEOUT, and SockError.
Referenced by css_setup_server_loop().
int css_notify_ha_log_applier_state | ( | THREAD_ENTRY * | thread_p, |
HA_LOG_APPLIER_STATE | state | ||
) |
Definition at line 2396 of file server_support.c.
References ip_info::address_list, ARG_FILE_LINE, assert, ha_log_applier_state_table::client_id, CSECT_ACL, csect_enter, csect_enter_as_reader, csect_exit, CSECT_HA_SERVER_STATE, css_check_accessibility(), css_check_ha_log_applier_done(), css_check_ha_log_applier_working(), css_check_ip(), css_free_accessible_ip_info(), css_free_ip_info(), css_get_client_id(), css_ha_applier_state_string(), css_read_ip_info(), css_set_accessible_ip_info(), css_transit_ha_server_state(), envvar_confdir_file(), ER_ERROR_SEVERITY, ER_FAILED, ER_INACCESSIBLE_IP, er_log_debug, er_set(), HA_LOG_APPLIER_STATE_ERROR, ha_Log_applier_state_num, HA_LOG_APPLIER_STATE_UNREGISTERED, ha_Server_num_of_hosts, HA_SERVER_STATE_ACTIVE, HA_SERVER_STATE_STANDBY, i, INF_WAIT, IP_BYTE_COUNT, ip_file_real_path, ip_list_file_name, logtb_disable_update(), logtb_enable_update(), NO_ERROR, NULL, ip_info::num_list, PATH_SEPARATOR, prm_get_bool_value(), prm_get_string_value(), PRM_ID_ACCESS_IP_CONTROL, PRM_ID_ACCESS_IP_CONTROL_FILE, ha_log_applier_state_table::state, strlen, xacl_dump(), and xacl_reload().
Referenced by sboot_notify_ha_log_applier_state(), xboot_register_client(), and xboot_unregister_client().
char* css_pack_server_name | ( | const char * | server_name, |
int * | name_length | ||
) |
Definition at line 1790 of file server_support.c.
References ARG_FILE_LINE, envvar_root(), ER_ERROR_SEVERITY, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), HA_DISABLED, NULL, rel_major_release_string(), and strlen.
Referenced by css_reestablish_connection_to_master(), and net_server_start().
|
static |
Definition at line 738 of file server_support.c.
References ARG_FILE_LINE, assert, css_change_ha_server_state(), css_get_master_request(), css_ha_server_state(), css_send_heartbeat_data(), css_send_heartbeat_request(), ER_ERROR_SEVERITY, er_log_debug, er_set(), ERR_CSS_ERROR_FROM_SERVER, HA_CHANGE_MODE_IMMEDIATELY, HA_SERVER_STATE_ACTIVE, HA_SERVER_STATE_STANDBY, htonl(), NO_ERROR, NULL, SERVER_CHANGE_HA_MODE, ha_log_applier_state_table::state, and thread_get_thread_entry_info().
Referenced by css_process_master_request().
|
static |
Definition at line 773 of file server_support.c.
References assert, css_send_heartbeat_data(), css_send_heartbeat_request(), LOG_CS_ENTER_READ_MODE(), LOG_CS_EXIT(), log_get_eof_lsa(), NULL, OR_ALIGNED_BUF, OR_ALIGNED_BUF_SIZE, OR_ALIGNED_BUF_START, OR_LOG_LSA_ALIGNED_SIZE, or_pack_log_lsa(), SERVER_GET_EOF, and thread_get_thread_entry_info().
Referenced by css_process_master_request().
|
static |
Definition at line 710 of file server_support.c.
References ARG_FILE_LINE, ER_ERROR_SEVERITY, ER_IO_WRITE, er_set_with_oserror(), HA_DISABLED, ha_Server_state, HA_SERVER_STATE_NA, and htonl().
Referenced by css_process_master_request().
|
static |
Definition at line 533 of file server_support.c.
References css_get_master_request(), css_process_change_server_ha_mode_request(), css_process_get_eof_request(), css_process_get_server_ha_mode_request(), css_process_new_client(), css_process_shutdown_request(), SERVER_CHANGE_HA_MODE, SERVER_GET_EOF, SERVER_GET_HA_MODE, SERVER_HALT_EXECUTION, SERVER_REGISTER_HA_PROCESS, SERVER_RESUME_EXECUTION, SERVER_SHUTDOWN_IMMEDIATE, SERVER_START_NEW_CLIENT, SERVER_START_SHUTDOWN, SERVER_START_TRACING, SERVER_STOP_SHUTDOWN, and SERVER_STOP_TRACING.
Referenced by css_master_thread().
|
static |
Definition at line 663 of file server_support.c.
References ARG_FILE_LINE, ASSERT_ERROR_AND_SET, assert_release, css_check_accessibility(), css_Connect_handler, css_make_conn(), css_open_new_socket_from_master(), css_refuse_connection_request(), css_send_reply_to_new_client_request(), ER_CSS_CLIENTS_EXCEEDED, ER_ERROR_SEVERITY, er_set(), error(), IS_INVALID_SOCKET, NO_ERROR, NULL, NUM_NORMAL_TRANS, prm_get_bool_value(), PRM_ID_ACCESS_IP_CONTROL, SERVER_CLIENTS_EXCEEDED, SERVER_CONNECTED, and SERVER_INACCESSIBLE_IP.
Referenced by css_process_master_request().
|
static |
Definition at line 585 of file server_support.c.
References ARG_FILE_LINE, css_get_master_request(), css_readn(), ER_ERROR_SEVERITY, er_set_with_oserror(), ERR_CSS_SHUTDOWN_ERROR, and MASTER_TO_SRV_MSG_SIZE.
Referenced by css_process_master_request().
void css_push_external_task | ( | CSS_CONN_ENTRY * | conn, |
cubthread::entry_task * | task | ||
) |
Definition at line 2741 of file server_support.c.
References cubthread::manager::push_task(), and thread_get_manager().
Referenced by fileio_write_backup_node(), log_abort_all_active_transaction(), and px_sort_assign().
|
static |
Definition at line 2727 of file server_support.c.
References cubthread::manager::push_task_on_core(), and thread_get_manager().
Referenced by css_connection_handler_thread().
unsigned int css_receive_data_from_client | ( | CSS_CONN_ENTRY * | conn, |
unsigned int | eid, | ||
char ** | buffer, | ||
int * | size | ||
) |
Definition at line 1721 of file server_support.c.
References css_receive_data_from_client_with_timeout().
Referenced by sbtree_load_index(), ses_posix_write_file(), slocator_fetch_lockhint_classes(), slocator_fetch_lockset(), slocator_force(), slocator_repl_force(), sqmgr_execute_query(), sqmgr_prepare_and_execute_query(), sqmgr_prepare_query(), ssession_create_prepared_statement(), ssession_drop_session_variables(), ssession_set_session_variables(), and stran_server_set_global_tran_info().
unsigned int css_receive_data_from_client_with_timeout | ( | CSS_CONN_ENTRY * | conn, |
unsigned int | eid, | ||
char ** | buffer, | ||
int * | size, | ||
int | timeout | ||
) |
Definition at line 1738 of file server_support.c.
References assert, css_receive_data(), CSS_RID_FROM_EID, css_test_for_client_errors(), NO_ERRORS, NULL, rc, and RECORD_TRUNCATED.
Referenced by css_receive_data_from_client(), and xs_receive_data_from_client_with_timeout().
|
static |
Definition at line 936 of file server_support.c.
References css_connect_to_master_server(), css_free_conn(), css_Master_port_id, css_Master_server_name, css_pack_server_name(), css_Pipe_to_master, CSS_WAIT_COUNT, css_conn_entry::fd, free_and_init, i, INVALID_SOCKET, and NULL.
Referenced by css_master_thread().
|
static |
Definition at line 614 of file server_support.c.
References assert, css_dealloc_conn_rmutex(), css_initialize_conn(), css_read_header(), css_send_error(), css_send_reply_to_new_client_request(), css_shutdown_conn(), css_conn_entry::db_error, DEFAULT_HEADER_DATA, er_clear(), er_get_area_error(), error(), NO_ERROR, NO_ERRORS, OR_ALIGNED_BUF, OR_ALIGNED_BUF_START, rmutex_initialize, and RMUTEX_NAME_TEMP_CONN_ENTRY.
Referenced by css_is_shutdown_timeout_expired(), and css_process_new_client().
unsigned int css_send_abort_to_client | ( | CSS_CONN_ENTRY * | conn, |
unsigned int | eid | ||
) |
Definition at line 1677 of file server_support.c.
References assert, CSS_RID_FROM_EID, css_send_abort_request(), NO_ERRORS, NULL, and rc.
Referenced by net_server_request(), sacl_dump(), sboot_compact_db(), sboot_initialize_server(), sbtree_load_index(), ses_posix_read_file(), ses_posix_write_file(), slocator_fetch_lockhint_classes(), slocator_fetch_lockset(), slocator_force(), slocator_repl_force(), slock_dump(), slogpb_dump_stat(), slogtb_dump_trantable(), smnt_server_copy_global_stats(), smnt_server_copy_stats(), sprm_server_dump_parameters(), sqmgr_dump_query_cache(), sqmgr_dump_query_plans(), sqmgr_execute_query(), sqmgr_prepare_and_execute_query(), sqmgr_prepare_query(), ssession_create_prepared_statement(), ssession_drop_session_variables(), ssession_set_session_variables(), sthread_dump_cs_stat(), stran_server_2pc_recovery_prepared(), stran_server_get_global_tran_info(), stran_server_set_global_tran_info(), and svacuum_dump().
unsigned int css_send_data_to_client | ( | CSS_CONN_ENTRY * | conn, |
unsigned int | eid, | ||
char * | buffer, | ||
int | buffer_size | ||
) |
Definition at line 1457 of file server_support.c.
References assert, CSS_RID_FROM_EID, css_send_data(), NO_ERRORS, NULL, and rc.
Referenced by sacl_dump(), sacl_reload(), sboot_add_volume_extension(), sboot_backup(), sboot_change_ha_mode(), sboot_check_db_consistency(), sboot_compact_db(), sboot_compact_start(), sboot_compact_stop(), sboot_find_last_permanent(), sboot_find_last_temp(), sboot_find_number_permanent_volumes(), sboot_find_number_temp_volumes(), sboot_heap_compact(), sboot_notify_ha_log_applier_state(), sboot_notify_unregister_client(), sbtree_add_index(), sbtree_class_test_unique(), sbtree_delete_index(), sbtree_find_unique_internal(), sbtree_get_statistics(), sbtree_load_index(), schksum_insert_repl_log_and_demote_table_lock(), sct_check_rep_dir(), sdk_freepgs(), sdk_totalpgs(), server_ping(), server_ping_with_handshake(), ses_posix_delete_file(), ses_posix_get_file_size(), ses_posix_write_file(), sfile_apply_tde_to_class_files(), shf_create(), shf_destroy(), shf_destroy_when_new(), shf_get_class_num_objs_and_pages(), shf_has_instance(), shf_heap_reclaim_addresses(), sjsp_get_server_port(), sloaddb_destroy(), sloaddb_init(), sloaddb_update_stats(), slocator_assign_oid(), slocator_assign_oid_batch(), slocator_check_fk_validity(), slocator_delete_class_name(), slocator_demote_class_lock(), slocator_does_exist(), slocator_fetch(), slocator_fetch_all(), slocator_fetch_all_reference_lockset(), slocator_fetch_lockhint_classes(), slocator_fetch_lockset(), slocator_find_class_oid(), slocator_find_lockhint_class_oids(), slocator_get_class(), slocator_get_reserved_class_name_oid(), slocator_notify_isolation_incons(), slocator_redistribute_partition_data(), slocator_remove_class_from_index(), slocator_rename_class_name(), slocator_reserve_classnames(), slocator_upgrade_instances_domain(), slock_dump(), slog_add_lob_locator(), slog_change_state_of_locator(), slog_checkpoint(), slog_drop_lob_locator(), slogin_user(), slogpb_dump_stat(), slogtb_does_active_user_exist(), slogtb_dump_trantable(), slogtb_get_mvcc_snapshot(), slogtb_get_pack_tran_table(), slogtb_reset_isolation(), slogtb_reset_wait_msecs(), slogtb_set_suppress_repl_on_transaction(), slogwr_get_log_pages(), smnt_server_copy_global_stats(), smnt_server_copy_stats(), smnt_server_start_stats(), smnt_server_stop_stats(), sprm_server_change_parameters(), sprm_server_dump_parameters(), sqmgr_drop_all_query_plans(), sqmgr_dump_query_cache(), sqmgr_dump_query_plans(), sqmgr_end_query(), sqp_get_sys_timestamp(), sqst_update_all_statistics(), sqst_update_statistics(), srepl_log_get_append_lsa(), srepl_set_info(), sserial_decache(), ssession_create_prepared_statement(), ssession_delete_prepared_statement(), ssession_drop_session_variables(), ssession_end_session(), ssession_get_row_count(), ssession_reset_cur_insert_id(), ssession_set_row_count(), ssession_set_session_variables(), stde_change_mk_on_server(), stde_get_mk_info(), sthread_dump_cs_stat(), sthread_kill_or_interrupt_tran(), sthread_kill_tran_index(), stran_get_local_transaction_id(), stran_is_blocked(), stran_lock_rep_read(), stran_server_2pc_attach_global_tran(), stran_server_2pc_prepare(), stran_server_2pc_prepare_global_tran(), stran_server_2pc_recovery_prepared(), stran_server_2pc_start(), stran_server_abort(), stran_server_commit(), stran_server_end_topop(), stran_server_has_updated(), stran_server_is_active_and_has_updated(), stran_server_partial_abort(), stran_server_savepoint(), stran_server_set_global_tran_info(), stran_server_start_topop(), stran_wait_server_active_trans(), svacuum(), svacuum_dump(), and xs_send_action_to_client().
unsigned int css_send_error_to_client | ( | CSS_CONN_ENTRY * | conn, |
unsigned int | eid, | ||
char * | buffer, | ||
int | buffer_size | ||
) |
Definition at line 1660 of file server_support.c.
References assert, CSS_RID_FROM_EID, css_send_error(), NO_ERRORS, NULL, and rc.
Referenced by return_error_to_client().
unsigned int css_send_reply_and_2_data_to_client | ( | CSS_CONN_ENTRY * | conn, |
unsigned int | eid, | ||
char * | reply, | ||
int | reply_size, | ||
char * | buffer1, | ||
int | buffer1_size, | ||
char * | buffer2, | ||
int | buffer2_size | ||
) |
Definition at line 1593 of file server_support.c.
References assert, CSS_RID_FROM_EID, css_send_reply_and_data_to_client(), NO_ERRORS, NULL, and rc.
Referenced by css_send_reply_and_3_data_to_client(), slocator_does_exist(), slocator_fetch(), slocator_fetch_all(), slocator_force(), slocator_get_class(), slocator_notify_isolation_incons(), and slocator_repl_force().
unsigned int css_send_reply_and_3_data_to_client | ( | CSS_CONN_ENTRY * | conn, |
unsigned int | eid, | ||
char * | reply, | ||
int | reply_size, | ||
char * | buffer1, | ||
int | buffer1_size, | ||
char * | buffer2, | ||
int | buffer2_size, | ||
char * | buffer3, | ||
int | buffer3_size | ||
) |
Definition at line 1628 of file server_support.c.
References assert, CSS_RID_FROM_EID, css_send_reply_and_2_data_to_client(), NO_ERRORS, NULL, and rc.
Referenced by slocator_fetch_all_reference_lockset(), slocator_fetch_lockhint_classes(), slocator_fetch_lockset(), slocator_find_lockhint_class_oids(), sqmgr_execute_query(), and sqmgr_prepare_and_execute_query().
unsigned int css_send_reply_and_data_to_client | ( | CSS_CONN_ENTRY * | conn, |
unsigned int | eid, | ||
char * | reply, | ||
int | reply_size, | ||
char * | buffer, | ||
int | buffer_size | ||
) |
Definition at line 1481 of file server_support.c.
References ARG_FILE_LINE, assert, css_Conn_array, CSS_ENTRYID_FROM_EID, CSS_RID_FROM_EID, css_send_data(), eid, ER_ERROR_SEVERITY, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), i, NO_ERROR, NO_ERRORS, NULL, and rc.
Referenced by css_send_reply_and_2_data_to_client(), netsr_spacedb(), sboot_get_locales_info(), sboot_get_timezone_checksum(), sboot_register_client(), sbtree_find_multi_uniques(), sbtree_get_key_type(), sdk_remarks(), sdk_vlabel(), ses_posix_copy_file(), ses_posix_create_file(), ses_posix_read_file(), ses_posix_rename_file(), sloaddb_fetch_status(), sloaddb_install_class(), sloaddb_load_batch(), slog_find_lob_locator(), sprm_server_get_force_parameters(), sprm_server_obtain_parameters(), sqfile_get_list_file_page(), sqmgr_prepare_query(), sqp_get_server_info(), sqst_server_get_statistics(), sserial_get_current_value(), sserial_get_next_value(), ssession_find_or_create_session(), ssession_get_last_insert_id(), ssession_get_prepared_statement(), ssession_get_session_variable(), stde_get_data_keys(), stde_get_mk_file_path(), stran_server_get_global_tran_info(), xcallback_console_print(), xio_send_user_prompt_to_client(), xlog_send_log_pages_to_client(), and xs_send_method_call_info_to_client().
|
static |
Definition at line 601 of file server_support.c.
References css_send_data(), and htonl().
Referenced by css_is_shutdown_timeout_expired(), css_process_new_client(), and css_refuse_connection_request().
void css_set_ha_num_of_hosts | ( | int | num | ) |
Definition at line 1955 of file server_support.c.
References HA_LOG_APPLIER_STATE_TABLE_MAX, and ha_Server_num_of_hosts.
Referenced by boot_restart_server(), and sboot_change_ha_mode().
void css_set_ha_repl_delayed | ( | void | ) |
Definition at line 1997 of file server_support.c.
References ha_Repl_delay_detected.
Referenced by log_is_log_flush_daemon_available().
|
static |
Definition at line 376 of file server_support.c.
References css_Shutdown_timeout, NULL, THREAD_CALLING_CONVENTION, and THREAD_RET_T.
Referenced by css_master_thread().
void css_set_thread_info | ( | THREAD_ENTRY * | thread_p, |
int | client_id, | ||
int | rid, | ||
int | tran_index, | ||
int | net_request_index | ||
) |
Definition at line 2663 of file server_support.c.
References ha_log_applier_state_table::client_id, NULL, and thread_clear_recursion_depth().
Referenced by css_internal_request_handler(), and net_server_conn_down().
|
static |
Definition at line 315 of file server_support.c.
References ARG_FILE_LINE, css_master_thread(), css_Pipe_to_master, ER_ERROR_SEVERITY, er_set_with_oserror(), ERR_CSS_MASTER_PIPE_ERROR, IS_INVALID_SOCKET, jsp_jvm_is_loaded(), and os_set_signal_handler().
Referenced by css_init().
|
static |
Definition at line 3268 of file server_support.c.
References ARG_FILE_LINE, cubregex::count(), css_get_connection_thread_pooling_configuration(), css_get_server_request_thread_pooling_configuration(), er_log_debug, NULL, cubthread::worker_pool< Context >::start_all_workers(), and start_time.
Referenced by css_transit_ha_server_state().
void css_start_shutdown_server | ( | ) |
Definition at line 1285 of file server_support.c.
References css_Server_shutdown_inited.
Referenced by css_init().
|
static |
Definition at line 2937 of file server_support.c.
References _exit(), ARG_FILE_LINE, css_block_all_active_conn(), css_find_not_stopped(), css_is_shutdown_timeout_expired(), css_stop_log_writer(), css_stop_non_log_writer(), er_log_debug, cubthread::worker_pool< Context >::map_running_contexts(), NULL, THREAD_STOP_LOGWR, and THREAD_STOP_WORKERS_EXCEPT_LOGWR.
Referenced by css_init().
|
static |
Definition at line 2863 of file server_support.c.
References css_is_log_writer(), lock_force_thread_timeout_lock(), logtb_is_current_active(), thread_check_suspend_reason_and_wakeup(), THREAD_LOGWR_SUSPENDED, THREAD_RESUME_DUE_TO_INTERRUPT, and cubthread::entry::TS_WAIT.
Referenced by css_stop_all_workers().
|
static |
Definition at line 2819 of file server_support.c.
References css_is_log_writer(), lock_force_thread_timeout_lock(), logtb_is_current_active(), logtb_set_tran_index_interrupt(), NULL, NULL_TRAN_INDEX, thread_lock_entry(), THREAD_RESUME_DUE_TO_INTERRUPT, thread_unlock_entry(), thread_wakeup_already_had_mutex(), and cubthread::entry::TS_WAIT.
Referenced by css_stop_all_workers().
|
static |
Definition at line 1695 of file server_support.c.
References assert, css_return_queued_error(), CSS_RID_FROM_EID, er_set_area_error(), free_and_init, NO_ERROR, NULL, and rc.
Referenced by css_receive_data_from_client_with_timeout().
|
static |
Definition at line 2016 of file server_support.c.
References ARG_FILE_LINE, csect_enter, csect_exit, CSECT_HA_SERVER_STATE, css_ha_server_state_string(), css_start_all_threads(), ER_CSS_SERVER_HA_MODE_CHANGE, ER_ERROR_SEVERITY, er_log_debug, er_set(), HA_DISABLED, ha_Server_state, HA_SERVER_STATE_ACTIVE, HA_SERVER_STATE_IDLE, HA_SERVER_STATE_MAINTENANCE, HA_SERVER_STATE_NA, HA_SERVER_STATE_STANDBY, HA_SERVER_STATE_TO_BE_ACTIVE, HA_SERVER_STATE_TO_BE_STANDBY, INF_WAIT, log_append_ha_server_state(), log_set_ha_promotion_time(), PRM_ID_HA_SERVER_STATE, and prm_set_integer_value().
Referenced by css_change_ha_server_state(), css_check_ha_server_state_for_client(), and css_notify_ha_log_applier_state().
void css_unset_ha_repl_delayed | ( | void | ) |
Definition at line 2003 of file server_support.c.
References ha_Repl_delay_detected.
Referenced by log_is_log_flush_daemon_available().
|
static |
Definition at line 3079 of file server_support.c.
References assert, CSS_JOB_QUEUE_SCAN_COLUMN_COUNT, css_wp_worker_get_busy_count_mapper(), db_make_int(), ER_FAILED, cubthread::worker_pool< Context >::core::get_max_worker_count(), cubthread::worker_pool< Context >::core::map_running_contexts(), NULL, and showstmt_alloc_tuple_in_context().
|
static |
Definition at line 3053 of file server_support.c.
References NULL_TRAN_INDEX.
Referenced by css_wp_core_job_scan_mapper().
|
static |
Definition at line 135 of file server_support.c.
|
static |
Definition at line 205 of file server_support.c.
Referenced by css_wp_core_job_scan_mapper().
|
static |
Definition at line 101 of file server_support.c.
|
static |
Definition at line 100 of file server_support.c.
Referenced by css_init(), and css_reestablish_connection_to_master().
|
static |
Definition at line 99 of file server_support.c.
Referenced by css_init(), and css_reestablish_connection_to_master().
|
static |
Definition at line 102 of file server_support.c.
|
static |
Definition at line 107 of file server_support.c.
Referenced by css_initialize_server_interfaces(), and css_internal_request_handler().
|
static |
Definition at line 134 of file server_support.c.
|
static |
Definition at line 96 of file server_support.c.
Referenced by css_is_shutdowning_server(), and css_start_shutdown_server().
|
static |
Definition at line 97 of file server_support.c.
Referenced by css_is_shutdown_timeout_expired(), and css_set_shutdown_timeout().
|
static |
Definition at line 123 of file server_support.c.
|
static |
Definition at line 131 of file server_support.c.
Referenced by css_notify_ha_log_applier_state().
|
static |
Definition at line 111 of file server_support.c.
Referenced by css_is_ha_repl_delayed(), css_set_ha_repl_delayed(), and css_unset_ha_repl_delayed().
|
static |
Definition at line 113 of file server_support.c.
Referenced by css_check_ha_log_applier_done(), css_check_ha_log_applier_working(), css_get_ha_num_of_hosts(), css_notify_ha_log_applier_state(), and css_set_ha_num_of_hosts().
|
static |
Definition at line 110 of file server_support.c.
Referenced by css_change_ha_server_state(), css_check_ha_log_applier_done(), css_check_ha_log_applier_working(), css_check_ha_server_state_for_client(), css_connection_handler_thread(), css_ha_server_state(), css_process_get_server_ha_mode_request(), and css_transit_ha_server_state().
|
static |
Definition at line 104 of file server_support.c.
Referenced by css_notify_ha_log_applier_state().
|
static |
Definition at line 103 of file server_support.c.
Referenced by css_notify_ha_log_applier_state().