CUBRID Engine  latest
server_support.h File Reference
#include "connection_defs.h"
#include "connection_sr.h"
#include "thread_entry.hpp"
#include "thread_entry_task.hpp"
Include dependency graph for server_support.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  css_thread_stop_type { THREAD_STOP_WORKERS_EXCEPT_LOGWR, THREAD_STOP_LOGWR }
 

Functions

void css_block_all_active_conn (unsigned short stop_phase)
 
THREAD_RET_T THREAD_CALLING_CONVENTION css_master_thread (void)
 
unsigned int css_send_error_to_client (CSS_CONN_ENTRY *conn, unsigned int eid, char *buffer, int buffer_size)
 
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_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)
 
unsigned int css_send_abort_to_client (CSS_CONN_ENTRY *conn, unsigned int eid)
 
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_handler)
 
char * css_pack_server_name (const char *server_name, int *name_length)
 
int css_init (THREAD_ENTRY *thread_p, char *server_name, int server_name_length, int connection_id)
 
char * css_add_client_version_string (THREAD_ENTRY *thread_p, const char *version_string)
 
void css_cleanup_server_queues (unsigned int eid)
 
void css_end_server_request (CSS_CONN_ENTRY *conn)
 
bool css_is_shutdown_timeout_expired (void)
 
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)
 
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)
 
void css_set_thread_info (THREAD_ENTRY *thread_p, int client_id, int rid, int tran_index, int net_request_index)
 
int css_get_client_id (THREAD_ENTRY *thread_p)
 
unsigned int css_get_comm_request_id (THREAD_ENTRY *thread_p)
 
struct css_conn_entrycss_get_current_conn_entry (void)
 
int css_job_queues_start_scan (THREAD_ENTRY *thread_p, int show_type, DB_VALUE **arg_values, int arg_cnt, void **ptr)
 

Enumeration Type Documentation

Enumerator
THREAD_STOP_WORKERS_EXCEPT_LOGWR 
THREAD_STOP_LOGWR 

Definition at line 36 of file server_support.h.

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  )
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:

size_t css_count_transaction_worker_threads ( THREAD_ENTRY thread_p,
int  tran_index,
int  client_id 
)
void css_end_server_request ( CSS_CONN_ENTRY conn)
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)
struct 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.

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  )
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:

int css_init ( THREAD_ENTRY thread_p,
char *  server_name,
int  server_name_length,
int  connection_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_handler 
)

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:

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:

int css_job_queues_start_scan ( THREAD_ENTRY thread_p,
int  show_type,
DB_VALUE **  arg_values,
int  arg_cnt,
void **  ptr 
)
inline

Definition at line 115 of file server_support.h.

References NO_ERROR, and NULL.

Referenced by showstmt_scan_init().

Here is the caller graph for this function:

char* css_pack_server_name ( const char *  server_name,
int *  name_length 
)
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:

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:

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 
)
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:

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:

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: