CUBRID Engine  latest
server_support.c File Reference
#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
 

Functions

static void css_setup_server_loop (void)
 
static int css_check_conn (CSS_CONN_ENTRY *p)
 
static void css_set_shutdown_timeout (int timeout)
 
static int css_get_master_request (SOCKET master_fd)
 
static int css_process_master_request (SOCKET master_fd)
 
static void css_process_shutdown_request (SOCKET master_fd)
 
static void css_send_reply_to_new_client_request (CSS_CONN_ENTRY *conn, unsigned short rid, int reason)
 
static void css_refuse_connection_request (SOCKET new_fd, unsigned short rid, int reason, int error)
 
static void css_process_new_client (SOCKET master_fd)
 
static void css_process_get_server_ha_mode_request (SOCKET master_fd)
 
static void css_process_change_server_ha_mode_request (SOCKET master_fd)
 
static void css_process_get_eof_request (SOCKET master_fd)
 
static void css_close_connection_to_master (void)
 
static int css_reestablish_connection_to_master (void)
 
static int css_connection_handler_thread (THREAD_ENTRY *thrd, CSS_CONN_ENTRY *conn)
 
static css_error_code css_internal_connection_handler (CSS_CONN_ENTRY *conn)
 
static int css_internal_request_handler (THREAD_ENTRY &thread_ref, CSS_CONN_ENTRY &conn_ref)
 
static int css_test_for_client_errors (CSS_CONN_ENTRY *conn, unsigned int eid)
 
static int css_check_accessibility (SOCKET new_fd)
 
static bool css_check_ha_log_applier_done (void)
 
static bool css_check_ha_log_applier_working (void)
 
static void css_push_server_task (CSS_CONN_ENTRY &conn_ref)
 
static void css_stop_non_log_writer (THREAD_ENTRY &thread_ref, bool &, THREAD_ENTRY &stopper_thread_ref)
 
static void css_stop_log_writer (THREAD_ENTRY &thread_ref, bool &)
 
static void css_find_not_stopped (THREAD_ENTRY &thread_ref, bool &stop, bool is_log_writer, bool &found)
 
static bool css_is_log_writer (const THREAD_ENTRY &thread_arg)
 
static void css_stop_all_workers (THREAD_ENTRY &thread_ref, css_thread_stop_type stop_phase)
 
static void css_wp_worker_get_busy_count_mapper (THREAD_ENTRY &thread_ref, bool &stop_mapper, int &busy_count)
 
static void css_wp_core_job_scan_mapper (const cubthread::entry_workpool::core &wp_core, bool &stop_mapper, THREAD_ENTRY *thread_p, SHOWSTMT_ARRAY_CONTEXT *ctx, size_t &core_index, int &error_code)
 
static void css_is_any_thread_not_suspended_mapfunc (THREAD_ENTRY &thread_ref, bool &stop_mapper, size_t &count, bool &found)
 
static void css_count_transaction_worker_threads_mapfunc (THREAD_ENTRY &thread_ref, bool &stop_mapper, THREAD_ENTRY *caller_thread, int tran_index, int client_id, size_t &count)
 
static HA_SERVER_STATE css_transit_ha_server_state (THREAD_ENTRY *thread_p, HA_SERVER_STATE req_state)
 
static bool css_get_connection_thread_pooling_configuration (void)
 
static cubthread::wait_seconds css_get_connection_thread_timeout_configuration (void)
 
static bool css_get_server_request_thread_pooling_configuration (void)
 
static cubthread::wait_seconds css_get_server_request_thread_timeout_configuration (void)
 
static void css_start_all_threads (void)
 
THREAD_RET_T THREAD_CALLING_CONVENTION css_master_thread (void)
 
bool css_is_shutdown_timeout_expired (void)
 
void css_block_all_active_conn (unsigned short stop_phase)
 
void css_initialize_server_interfaces (int(*request_handler)(THREAD_ENTRY *thrd, unsigned int eid, int request, int size, char *buffer), CSS_THREAD_FN connection_error_function)
 
bool css_is_shutdowning_server ()
 
void css_start_shutdown_server ()
 
int css_init (THREAD_ENTRY *thread_p, char *server_name, int name_length, int port_id)
 
unsigned int css_send_data_to_client (CSS_CONN_ENTRY *conn, unsigned int eid, char *buffer, int buffer_size)
 
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)
 
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)
 
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)
 
unsigned int css_send_error_to_client (CSS_CONN_ENTRY *conn, unsigned int eid, char *buffer, int buffer_size)
 
unsigned int css_send_abort_to_client (CSS_CONN_ENTRY *conn, unsigned int eid)
 
unsigned int css_receive_data_from_client (CSS_CONN_ENTRY *conn, unsigned int eid, char **buffer, int *size)
 
unsigned int css_receive_data_from_client_with_timeout (CSS_CONN_ENTRY *conn, unsigned int eid, char **buffer, int *size, int timeout)
 
void css_end_server_request (CSS_CONN_ENTRY *conn)
 
char * css_pack_server_name (const char *server_name, int *name_length)
 
char * css_add_client_version_string (THREAD_ENTRY *thread_p, const char *version_string)
 
void css_cleanup_server_queues (unsigned int eid)
 
void css_set_ha_num_of_hosts (int num)
 
int css_get_ha_num_of_hosts (void)
 
HA_SERVER_STATE css_ha_server_state (void)
 
bool css_is_ha_repl_delayed (void)
 
void css_set_ha_repl_delayed (void)
 
void css_unset_ha_repl_delayed (void)
 
int css_check_ha_server_state_for_client (THREAD_ENTRY *thread_p, int whence)
 
int css_change_ha_server_state (THREAD_ENTRY *thread_p, HA_SERVER_STATE state, bool force, int timeout, bool heartbeat)
 
int css_notify_ha_log_applier_state (THREAD_ENTRY *thread_p, HA_LOG_APPLIER_STATE state)
 
int css_get_client_id (THREAD_ENTRY *thread_p)
 
void css_set_thread_info (THREAD_ENTRY *thread_p, int client_id, int rid, int tran_index, int net_request_index)
 
unsigned int css_get_comm_request_id (THREAD_ENTRY *thread_p)
 
CSS_CONN_ENTRYcss_get_current_conn_entry (void)
 
void css_push_external_task (CSS_CONN_ENTRY *conn, cubthread::entry_task *task)
 
void css_get_thread_stats (UINT64 *stats_out)
 
size_t css_get_num_request_workers (void)
 
size_t css_get_num_connection_workers (void)
 
size_t css_get_num_total_workers (void)
 
bool css_are_all_request_handlers_suspended (void)
 
size_t css_count_transaction_worker_threads (THREAD_ENTRY *thread_p, int tran_index, int client_id)
 

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_ENTRYcss_Master_conn
 
static IP_INFOcss_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_workpoolcss_Server_request_worker_pool = NULL
 
static cubthread::entry_workpoolcss_Connection_worker_pool = NULL
 
static const size_t CSS_JOB_QUEUE_SCAN_COLUMN_COUNT = 4
 

Macro Definition Documentation

#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
#define FROM_UNREGISTER_CLIENT   2
#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 Documentation

Definition at line 116 of file server_support.c.

Function Documentation

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().

Here is the caller graph for this function:

bool css_are_all_request_handlers_suspended ( void  )
static int css_check_accessibility ( SOCKET  new_fd)
static

Referenced by css_is_shutdown_timeout_expired(), css_notify_ha_log_applier_state(), and css_process_new_client().

Here is the caller graph for this function:

static int css_check_conn ( CSS_CONN_ENTRY p)
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().

Here is the caller graph for this function:

static bool css_check_ha_log_applier_done ( void  )
static
static bool css_check_ha_log_applier_working ( void  )
static
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().

Here is the caller graph for this function:

static void css_close_connection_to_master ( void  )
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().

Here is the caller graph for this function:

size_t css_count_transaction_worker_threads ( THREAD_ENTRY thread_p,
int  tran_index,
int  client_id 
)
static void css_count_transaction_worker_threads_mapfunc ( THREAD_ENTRY thread_ref,
bool stop_mapper,
THREAD_ENTRY caller_thread,
int  tran_index,
int  client_id,
size_t &  count 
)
static
void css_end_server_request ( CSS_CONN_ENTRY conn)
static void css_find_not_stopped ( THREAD_ENTRY thread_ref,
bool stop,
bool  is_log_writer,
bool found 
)
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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

unsigned int css_get_comm_request_id ( THREAD_ENTRY thread_p)
static bool css_get_connection_thread_pooling_configuration ( void  )
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().

Here is the caller graph for this function:

static cubthread::wait_seconds css_get_connection_thread_timeout_configuration ( void  )
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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

int css_get_ha_num_of_hosts ( void  )

Definition at line 1975 of file server_support.c.

References ha_Server_num_of_hosts.

static int css_get_master_request ( SOCKET  master_fd)
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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

size_t css_get_num_total_workers ( void  )
static bool css_get_server_request_thread_pooling_configuration ( void  )
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().

Here is the caller graph for this function:

static cubthread::wait_seconds css_get_server_request_thread_timeout_configuration ( void  )
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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

static css_error_code css_internal_connection_handler ( CSS_CONN_ENTRY conn)
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().

Here is the caller graph for this function:

static void css_is_any_thread_not_suspended_mapfunc ( THREAD_ENTRY thread_ref,
bool stop_mapper,
size_t &  count,
bool found 
)
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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

static bool css_is_log_writer ( const THREAD_ENTRY thread_arg)
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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

char* css_pack_server_name ( const char *  server_name,
int *  name_length 
)
static void css_process_get_server_ha_mode_request ( SOCKET  master_fd)
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().

Here is the caller graph for this function:

static void css_process_shutdown_request ( SOCKET  master_fd)
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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

static void css_push_server_task ( CSS_CONN_ENTRY conn_ref)
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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

static int css_reestablish_connection_to_master ( void  )
static
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().

Here is the caller graph for this function:

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 
)
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 
)
static void css_send_reply_to_new_client_request ( CSS_CONN_ENTRY conn,
unsigned short  rid,
int  reason 
)
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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

static void css_set_shutdown_timeout ( int  timeout)
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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

static void css_setup_server_loop ( void  )
static
static void css_start_all_threads ( void  )
static
void css_start_shutdown_server ( )

Definition at line 1285 of file server_support.c.

References css_Server_shutdown_inited.

Referenced by css_init().

Here is the caller graph for this function:

static void css_stop_log_writer ( THREAD_ENTRY thread_ref,
bool stop_mapper 
)
static
static void css_stop_non_log_writer ( THREAD_ENTRY thread_ref,
bool stop_mapper,
THREAD_ENTRY stopper_thread_ref 
)
static
static int css_test_for_client_errors ( CSS_CONN_ENTRY conn,
unsigned int  eid 
)
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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

static void css_wp_worker_get_busy_count_mapper ( THREAD_ENTRY thread_ref,
bool stop_mapper,
int &  busy_count 
)
static

Definition at line 3053 of file server_support.c.

References NULL_TRAN_INDEX.

Referenced by css_wp_core_job_scan_mapper().

Here is the caller graph for this function:

Variable Documentation

cubthread::entry_workpool* css_Connection_worker_pool = NULL
static

Definition at line 135 of file server_support.c.

const size_t CSS_JOB_QUEUE_SCAN_COLUMN_COUNT = 4
static

Definition at line 205 of file server_support.c.

Referenced by css_wp_core_job_scan_mapper().

CSS_CONN_ENTRY* css_Master_conn
static

Definition at line 101 of file server_support.c.

int css_Master_port_id
static

Definition at line 100 of file server_support.c.

Referenced by css_init(), and css_reestablish_connection_to_master().

char* css_Master_server_name = NULL
static

Definition at line 99 of file server_support.c.

Referenced by css_init(), and css_reestablish_connection_to_master().

IP_INFO* css_Server_accessible_ip_info
static

Definition at line 102 of file server_support.c.

int(* css_Server_request_handler) (THREAD_ENTRY *, unsigned int, int, int, char *)
static
cubthread::entry_workpool* css_Server_request_worker_pool = NULL
static

Definition at line 134 of file server_support.c.

bool css_Server_shutdown_inited = false
static

Definition at line 96 of file server_support.c.

Referenced by css_is_shutdowning_server(), and css_start_shutdown_server().

struct timeval css_Shutdown_timeout = { 0, 0 }
static

Definition at line 97 of file server_support.c.

Referenced by css_is_shutdown_timeout_expired(), and css_set_shutdown_timeout().

int ha_Log_applier_state_num = 0
static

Definition at line 131 of file server_support.c.

Referenced by css_notify_ha_log_applier_state().

bool ha_Repl_delay_detected = false
static
char ip_file_real_path[PATH_MAX]
static

Definition at line 104 of file server_support.c.

Referenced by css_notify_ha_log_applier_state().

char* ip_list_file_name = NULL
static

Definition at line 103 of file server_support.c.

Referenced by css_notify_ha_log_applier_state().