CUBRID Engine  latest
log_applier.c File Reference
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/time.h>
#include <signal.h>
#include <pthread.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/socket.h>
#include <sys/un.h>
#include "log_applier.h"
#include "authenticate.h"
#include "porting.h"
#include "utility.h"
#include "environment_variable.h"
#include "message_catalog.h"
#include "msgcat_set_log.hpp"
#include "log_compress.h"
#include "log_lsa.hpp"
#include "parser.h"
#include "object_primitive.h"
#include "object_representation.h"
#include "db_value_printer.hpp"
#include "db.h"
#include "object_accessor.h"
#include "locator_cl.h"
#include "connection_cl.h"
#include "network_interface_cl.h"
#include "transform.h"
#include "file_io.h"
#include "memory_hash.h"
#include "schema_manager.h"
#include "log_applier_sql_log.h"
#include "util_func.h"
#include "dbtype.h"
#include "heartbeat.h"
#include "mem_block.hpp"
#include "string_buffer.hpp"

Go to the source code of this file.

Classes

struct  la_cache_buffer
 
struct  la_cache_buffer_area
 
struct  la_cache_pb
 
struct  la_repl_filter
 
struct  la_act_log
 
struct  la_arv_log
 
struct  la_item
 
struct  la_apply
 
struct  la_commit
 
struct  la_info
 
struct  la_ovf_first_part
 
struct  la_ovf_rest_parts
 
struct  la_ovf_page_list
 
struct  la_recdes_pool
 
struct  la_ha_apply_info
 

Macros

#define LA_DEFAULT_CACHE_BUFFER_SIZE   100
 
#define LA_MAX_REPL_ITEM_WITHOUT_RELEASE_PB   50
 
#define LA_MAX_UNFLUSHED_REPL_ITEMS   200
 
#define LA_DEFAULT_LOG_PAGE_SIZE   4096
 
#define LA_GET_PAGE_RETRY_COUNT   10
 
#define LA_REPL_LIST_COUNT   50
 
#define LA_PAGE_DOESNOT_EXIST   0
 
#define LA_PAGE_EXST_IN_ACTIVE_LOG   1
 
#define LA_PAGE_EXST_IN_ARCHIVE_LOG   2
 
#define LA_STATUS_BUSY   1
 
#define LA_STATUS_IDLE   0
 
#define LA_LOCK_SUFFIX   "_lgla__lock"
 
#define LA_QUERY_BUF_SIZE   2048
 
#define LA_MAX_REPL_ITEMS   1000
 
#define LA_NUM_DELAY_HISTORY   10
 
#define LA_MAX_TOLERABLE_DELAY   2
 
#define LA_REINIT_COMMIT_INTERVAL   10
 
#define LA_WS_CULL_MOPS_PER_APPLY   (100000)
 
#define LA_WS_CULL_MOPS_INTERVAL   (180)
 
#define LA_WS_CULL_MOPS_PER_APPLY_MIN   (100)
 
#define LA_WS_CULL_MOPS_INTERVAL_MIN   (2)
 
#define LA_NUM_REPL_FILTER   50
 
#define LA_LOG_IS_IN_ARCHIVE(pageid)   ((pageid) < la_Info.act_log.log_hdr->nxarv_pageid)
 
#define SIZEOF_LA_CACHE_LOG_BUFFER(io_pagesize)   (offsetof(LA_CACHE_BUFFER, logpage) + (io_pagesize))
 
#define LA_LOGAREA_SIZE   (la_Info.act_log.db_logpagesize - SSIZEOF(LOG_HDRPAGE))
 
#define LA_LOG_READ_ADVANCE_WHEN_DOESNT_FIT(result, length, offset, pageid, pgptr)
 
#define LA_LOG_READ_ALIGN(result, offset, pageid, log_pgptr)
 
#define LA_LOG_READ_ADD_ALIGN(result, add, offset, pageid, log_pgptr)
 
#define LA_SLEEP(sec, usec)
 
#define LA_MOVE_INSIDE_RECORD(rec, dest_offset, src_offset)
 
#define LA_IN_VALUE_COUNT   2
 
#define LA_OUT_VALUE_COUNT   23
 
#define LA_IN_VALUE_COUNT   15
 
#define LA_IN_VALUE_COUNT   2
 
#define LA_IN_VALUE_COUNT   3
 
#define LA_IN_VALUE_COUNT   22
 
#define LA_IN_VALUE_COUNT   2
 

Typedefs

typedef struct la_cache_buffer LA_CACHE_BUFFER
 
typedef struct la_cache_buffer_area LA_CACHE_BUFFER_AREA
 
typedef struct la_cache_pb LA_CACHE_PB
 
typedef struct la_repl_filter LA_REPL_FILTER
 
typedef struct la_act_log LA_ACT_LOG
 
typedef struct la_arv_log LA_ARV_LOG
 
typedef struct la_item LA_ITEM
 
typedef struct la_apply LA_APPLY
 
typedef struct la_commit LA_COMMIT
 
typedef struct la_info LA_INFO
 
typedef struct la_ovf_first_part LA_OVF_FIRST_PART
 
typedef struct la_ovf_rest_parts LA_OVF_REST_PARTS
 
typedef struct la_ovf_page_list LA_OVF_PAGE_LIST
 
typedef struct la_recdes_pool LA_RECDES_POOL
 
typedef struct la_ha_apply_info LA_HA_APPLY_INFO
 

Functions

static void la_shutdown_by_signal (int)
 
static void la_init_ha_apply_info (LA_HA_APPLY_INFO *ha_apply_info)
 
static LOG_PHY_PAGEID la_log_phypageid (LOG_PAGEID logical_pageid)
 
static int la_log_io_open (const char *vlabel, int flags, int mode)
 
static int la_log_io_read (char *vname, int vdes, void *io_pgptr, LOG_PHY_PAGEID pageid, int pagesize)
 
static int la_log_io_read_with_max_retries (char *vname, int vdes, void *io_pgptr, LOG_PHY_PAGEID pageid, int pagesize, int retries)
 
static int la_find_archive_num (int *arv_log_num, LOG_PAGEID pageid)
 
static int la_get_range_of_archive (int arv_log_num, LOG_PAGEID *fpageid, DKNPAGES *npages)
 
static int la_log_fetch_from_archive (LOG_PAGEID pageid, char *data)
 
static int la_log_fetch (LOG_PAGEID pageid, LA_CACHE_BUFFER *cache_buffer)
 
static int la_expand_cache_log_buffer (LA_CACHE_PB *cache_pb, int slb_cnt, int slb_size)
 
static LA_CACHE_BUFFERla_cache_buffer_replace (LA_CACHE_PB *cache_pb, LOG_PAGEID pageid, int io_pagesize, int buffer_size)
 
static LA_CACHE_BUFFERla_get_page_buffer (LOG_PAGEID pageid)
 
static LOG_PAGEla_get_page (LOG_PAGEID pageid)
 
static void la_release_page_buffer (LOG_PAGEID pageid)
 
static void la_release_all_page_buffers (LOG_PAGEID except_pageid)
 
static void la_invalidate_page_buffer (LA_CACHE_BUFFER *cache_buffer)
 
static void la_decache_page_buffers (LOG_PAGEID from, LOG_PAGEID to)
 
static int la_find_required_lsa (LOG_LSA *required_lsa)
 
static int la_get_ha_apply_info (const char *log_path, const char *prefix_name, LA_HA_APPLY_INFO *ha_apply_info)
 
static int la_insert_ha_apply_info (DB_DATETIME *creation_time)
 
static int la_update_ha_apply_info_start_time (void)
 
static int la_get_last_ha_applied_info (void)
 
static int la_update_ha_last_applied_info (void)
 
static int la_delete_ha_apply_info (void)
 
static bool la_ignore_on_error (int errid)
 
static bool la_retry_on_error (int errid)
 
static int la_init_recdes_pool (int page_size, int num_recdes)
 
static RECDESla_assign_recdes_from_pool (void)
 
static int la_realloc_recdes_data (RECDES *recdes, int data_size)
 
static void la_clear_recdes_pool (void)
 
static LA_CACHE_PBla_init_cache_pb (void)
 
static unsigned int log_pageid_hash (const void *key, unsigned int htsize)
 
static int la_init_cache_log_buffer (LA_CACHE_PB *cache_pb, int slb_cnt, int slb_size)
 
static int la_fetch_log_hdr (LA_ACT_LOG *act_log)
 
static int la_find_log_pagesize (LA_ACT_LOG *act_log, const char *logpath, const char *dbname, bool check_charset)
 
static bool la_apply_pre (void)
 
static int la_does_page_exist (LOG_PAGEID pageid)
 
static int la_init_repl_lists (bool need_realloc)
 
static bool la_is_repl_lists_empty ()
 
static LA_APPLYla_find_apply_list (int tranid)
 
static void la_log_copy_fromlog (char *rec_type, char *area, int length, LOG_PAGEID log_pageid, PGLENGTH log_offset, LOG_PAGE *log_pgptr)
 
static LA_ITEMla_new_repl_item (LOG_LSA *lsa, LOG_LSA *target_lsa)
 
static void la_add_repl_item (LA_APPLY *apply, LA_ITEM *item)
 
static DB_VALUEla_get_item_pk_value (LA_ITEM *item)
 
static LA_ITEMla_make_repl_item (LOG_PAGE *log_pgptr, int log_type, int tranid, LOG_LSA *lsa)
 
static void la_unlink_repl_item (LA_APPLY *apply, LA_ITEM *item)
 
static void la_free_repl_item (LA_APPLY *apply, LA_ITEM *item)
 
static void la_free_all_repl_items_except_head (LA_APPLY *apply)
 
static void la_free_all_repl_items (LA_APPLY *apply)
 
static void la_free_and_add_next_repl_item (LA_APPLY *apply, LA_ITEM *next_item, LOG_LSA *lsa)
 
static void la_clear_applied_info (LA_APPLY *apply)
 
static void la_clear_all_repl_and_commit_list (void)
 
static int la_set_repl_log (LOG_PAGE *log_pgptr, int log_type, int tranid, LOG_LSA *lsa)
 
static int la_add_node_into_la_commit_list (int tranid, LOG_LSA *lsa, int type, time_t eot_time)
 
static time_t la_retrieve_eot_time (LOG_PAGE *pgptr, LOG_LSA *lsa)
 
static int la_get_current (OR_BUF *buf, SM_CLASS *sm_class, int bound_bit_flag, DB_OTMPL *def, DB_VALUE *key, int offset_size)
 
static void la_make_room_for_mvcc_insid (RECDES *recdes)
 
static int la_disk_to_obj (MOBJ classobj, RECDES *record, DB_OTMPL *def, DB_VALUE *key)
 
static char * la_get_zipped_data (char *undo_data, int undo_length, bool is_diff, bool is_undo_zip, bool is_overflow, char **rec_type, char **data, int *length)
 
static int la_get_undoredo_diff (LOG_PAGE **pgptr, LOG_PAGEID *pageid, PGLENGTH *offset, bool *is_undo_zip, char **undo_data, int *undo_length)
 
static int la_get_log_data (LOG_RECORD_HEADER *lrec, LOG_LSA *lsa, LOG_PAGE *pgptr, unsigned int match_rcvindex, unsigned int *rcvindex, void **logs, char **rec_type, char **data, int *d_length)
 
static int la_get_overflow_recdes (LOG_RECORD_HEADER *lrec, void *logs, RECDES *recdes, unsigned int rcvindex)
 
static int la_get_next_update_log (LOG_RECORD_HEADER *prev_lrec, LOG_PAGE *pgptr, void **logs, char **rec_type, char **data, int *d_length)
 
static int la_get_relocation_recdes (LOG_RECORD_HEADER *lrec, LOG_PAGE *pgptr, unsigned int match_rcvindex, void **logs, char **rec_type, RECDES *recdes)
 
static int la_get_recdes (LOG_LSA *lsa, LOG_PAGE *pgptr, RECDES *recdes, unsigned int *rcvindex, char *rec_type)
 
static int la_apply_delete_log (LA_ITEM *item)
 
static int la_apply_update_log (LA_ITEM *item)
 
static int la_apply_insert_log (LA_ITEM *item)
 
static int la_update_query_execute (const char *sql, bool au_disable)
 
static int la_update_query_execute_with_values (const char *sql, int arg_count, DB_VALUE *vals, bool au_disable)
 
static int la_apply_statement_log (LA_ITEM *item)
 
static int la_apply_repl_log (int tranid, int rectype, LOG_LSA *commit_lsa, int *total_rows, LOG_PAGEID final_pageid)
 
static int la_apply_commit_list (LOG_LSA *lsa, LOG_PAGEID final_pageid)
 
static void la_free_repl_items_by_tranid (int tranid)
 
static int la_log_record_process (LOG_RECORD_HEADER *lrec, LOG_LSA *final, LOG_PAGE *pg_ptr)
 
static int la_change_state (void)
 
static int la_log_commit (bool update_commit_time)
 
static unsigned long la_get_mem_size (void)
 
static int la_check_mem_size (void)
 
static int la_check_time_commit (struct timeval *time, unsigned int threshold)
 
static void la_init (const char *log_path, const int max_mem_size)
 
static int la_check_duplicated (const char *logpath, const char *dbname, int *lockf_vdes, int *last_deleted_arv_num)
 
static int la_lock_dbname (int *lockf_vdes, char *db_name, char *log_path)
 
static int la_unlock_dbname (int *lockf_vdes, char *db_name, bool clear_owner)
 
static void la_shutdown (void)
 
static int la_remove_archive_logs (const char *db_name, int last_deleted_arv_num, int nxarv_num, int max_arv_count_to_delete)
 
static LA_ITEMla_get_next_repl_item (LA_ITEM *item, bool is_long_trans, LOG_LSA *last_lsa)
 
static LA_ITEMla_get_next_repl_item_from_list (LA_ITEM *item)
 
static LA_ITEMla_get_next_repl_item_from_log (LA_ITEM *item, LOG_LSA *last_lsa)
 
static int la_commit_transaction (void)
 
static int la_find_last_deleted_arv_num (void)
 
static bool la_restart_on_bulk_flush_error (int errid)
 
static char * la_get_hostname_from_log_path (char *log_path)
 
static int la_delay_replica (time_t eot_time)
 
static float la_get_avg (int *array, int size)
 
static void la_get_adaptive_time_commit_interval (int *time_commit_interval, int *delay_hist)
 
static int la_flush_repl_items (bool immediate)
 
static bool la_need_filter_out (LA_ITEM *item)
 
static int la_create_repl_filter (void)
 
static void la_destroy_repl_filter (void)
 
static void la_print_repl_filter_info (void)
 
static int check_reinit_copylog (void)
 
bool la_force_shutdown (void)
 
static int la_update_ha_apply_info_log_record_time (time_t new_time)
 
static LA_APPLYla_add_apply_list (int tranid)
 
static LOG_REC_HA_SERVER_STATEla_get_ha_server_state (LOG_PAGE *pgptr, LOG_LSA *lsa)
 
static int la_repl_add_object (MOP classop, LA_ITEM *item, RECDES *recdes)
 
static int la_update_last_deleted_arv_num (int lockf_vdes, int last_deleted_arv_num)
 
void la_print_log_header (const char *database_name, LOG_HEADER *hdr, bool verbose)
 
void la_print_log_arv_header (const char *database_name, LOG_ARV_HEADER *hdr, bool verbose)
 
int la_log_page_check (const char *database_name, const char *log_path, INT64 page_num, bool check_applied_info, bool check_copied_info, bool check_replica_info, bool verbose, LOG_LSA *copied_eof_lsa, LOG_LSA *copied_append_lsa, LOG_LSA *applied_final_lsa)
 
void la_print_delay_info (LOG_LSA working_lsa, LOG_LSA target_lsa, float process_rate)
 
static int la_add_repl_filter (const char *classname)
 
int la_apply_log_file (const char *database_name, const char *log_path, const int max_mem_size)
 

Variables

LA_INFO la_Info
 
LA_RECDES_POOL la_recdes_pool
 
static bool la_applier_need_shutdown = false
 
static bool la_applier_shutdown_by_signal = false
 
static char la_slave_db_name [DB_MAX_IDENTIFIER_LENGTH+1]
 
static char la_peer_host [CUB_MAXHOSTNAMELEN+1]
 
static bool la_enable_sql_logging = false
 

Macro Definition Documentation

#define LA_DEFAULT_CACHE_BUFFER_SIZE   100

Definition at line 82 of file log_applier.c.

Referenced by la_init().

#define LA_DEFAULT_LOG_PAGE_SIZE   4096

Definition at line 85 of file log_applier.c.

Referenced by la_find_log_pagesize(), and la_init().

#define LA_GET_PAGE_RETRY_COUNT   10

Definition at line 86 of file log_applier.c.

Referenced by la_apply_log_file().

#define LA_IN_VALUE_COUNT   15
#define LA_IN_VALUE_COUNT   2
#define LA_IN_VALUE_COUNT   3
#define LA_IN_VALUE_COUNT   22
#define LA_IN_VALUE_COUNT   2
#define LA_LOCK_SUFFIX   "_lgla__lock"

Definition at line 96 of file log_applier.c.

Referenced by la_check_duplicated().

#define LA_LOG_IS_IN_ARCHIVE (   pageid)    ((pageid) < la_Info.act_log.log_hdr->nxarv_pageid)

Definition at line 114 of file log_applier.c.

Referenced by la_log_fetch(), la_log_page_check(), and la_remove_archive_logs().

#define LA_LOG_READ_ADD_ALIGN (   result,
  add,
  offset,
  pageid,
  log_pgptr 
)
Value:
do { \
(offset) += (add); \
LA_LOG_READ_ALIGN(result, (offset), (pageid), (log_pgptr)); \
} while(0)
#define LA_LOG_READ_ALIGN(result, offset, pageid, log_pgptr)
Definition: log_applier.c:131

Definition at line 143 of file log_applier.c.

Referenced by la_get_log_data(), la_get_next_update_log(), and la_get_undoredo_diff().

#define LA_LOG_READ_ADVANCE_WHEN_DOESNT_FIT (   result,
  length,
  offset,
  pageid,
  pgptr 
)
Value:
do { \
if ((offset)+(length) >= LA_LOGAREA_SIZE) { \
if (((pgptr) = la_get_page(++(pageid))) == NULL) { \
result = ER_IO_READ; \
} \
(offset) = 0; \
} \
} while(0)
#define LA_LOGAREA_SIZE
Definition: log_applier.c:120
static LOG_PAGE * la_get_page(LOG_PAGEID pageid)
Definition: log_applier.c:1327
#define ER_IO_READ
Definition: error_code.h:62
#define NULL
Definition: freelistheap.h:34
if(extra_options)
Definition: dynamic_load.c:958

Definition at line 121 of file log_applier.c.

Referenced by la_get_ha_server_state(), la_get_log_data(), la_get_next_update_log(), la_log_copy_fromlog(), la_make_repl_item(), and la_retrieve_eot_time().

#define LA_LOG_READ_ALIGN (   result,
  offset,
  pageid,
  log_pgptr 
)
Value:
do { \
(offset) = DB_ALIGN((offset), MAX_ALIGNMENT); \
while ((offset) >= LA_LOGAREA_SIZE) { \
if (((log_pgptr) = la_get_page(++(pageid))) == NULL) { \
result = ER_IO_READ; \
} \
(offset) -= LA_LOGAREA_SIZE; \
(offset) = DB_ALIGN((offset), MAX_ALIGNMENT); \
} \
} while(0)
#define LA_LOGAREA_SIZE
Definition: log_applier.c:120
static LOG_PAGE * la_get_page(LOG_PAGEID pageid)
Definition: log_applier.c:1327
#define MAX_ALIGNMENT
Definition: memory_alloc.h:70
#define ER_IO_READ
Definition: error_code.h:62
#define NULL
Definition: freelistheap.h:34
if(extra_options)
Definition: dynamic_load.c:958
#define DB_ALIGN(offset, align)
Definition: memory_alloc.h:84
while(1)
Definition: cnvlex.c:816

Definition at line 131 of file log_applier.c.

Referenced by la_get_log_data(), la_get_next_update_log(), la_make_repl_item(), and la_retrieve_eot_time().

#define LA_LOGAREA_SIZE   (la_Info.act_log.db_logpagesize - SSIZEOF(LOG_HDRPAGE))

Definition at line 120 of file log_applier.c.

Referenced by la_log_copy_fromlog().

#define LA_MAX_REPL_ITEM_WITHOUT_RELEASE_PB   50

Definition at line 83 of file log_applier.c.

Referenced by la_apply_repl_log().

#define LA_MAX_REPL_ITEMS   1000

Definition at line 100 of file log_applier.c.

Referenced by la_set_repl_log().

#define LA_MAX_TOLERABLE_DELAY   2

Definition at line 104 of file log_applier.c.

Referenced by la_get_adaptive_time_commit_interval().

#define LA_MAX_UNFLUSHED_REPL_ITEMS   200

Definition at line 84 of file log_applier.c.

Referenced by la_apply_log_file(), and la_flush_repl_items().

#define LA_MOVE_INSIDE_RECORD (   rec,
  dest_offset,
  src_offset 
)
Value:
do \
{ \
assert ((rec) != NULL && (dest_offset) >= 0 && (src_offset) >= 0); \
assert (((rec)->length - (src_offset)) >= 0); \
assert (((rec)->area_size <= 0) || ((rec)->area_size >= (rec)->length)); \
assert (((rec)->area_size <= 0) \
|| (((rec)->length + ((dest_offset) - (src_offset))) \
<= (rec)->area_size)); \
if ((dest_offset) != (src_offset)) \
{ \
memmove ((rec)->data + (dest_offset), (rec)->data + (src_offset), \
(rec)->length - (src_offset)); \
(rec)->length = (rec)->length + ((dest_offset) - (src_offset)); \
} \
} \
while (0)
#define assert(x)
#define NULL
Definition: freelistheap.h:34
if(extra_options)
Definition: dynamic_load.c:958
while(1)
Definition: cnvlex.c:816

Definition at line 158 of file log_applier.c.

Referenced by la_make_room_for_mvcc_insid().

#define LA_NUM_DELAY_HISTORY   10

Definition at line 103 of file log_applier.c.

Referenced by la_apply_log_file(), and la_get_adaptive_time_commit_interval().

#define LA_NUM_REPL_FILTER   50

Definition at line 112 of file log_applier.c.

Referenced by la_add_repl_filter(), and la_create_repl_filter().

#define LA_OUT_VALUE_COUNT   23

Referenced by la_get_ha_apply_info().

#define LA_PAGE_DOESNOT_EXIST   0

Definition at line 89 of file log_applier.c.

Referenced by la_apply_log_file(), and la_does_page_exist().

#define LA_PAGE_EXST_IN_ACTIVE_LOG   1

Definition at line 90 of file log_applier.c.

Referenced by la_does_page_exist().

#define LA_PAGE_EXST_IN_ARCHIVE_LOG   2

Definition at line 91 of file log_applier.c.

Referenced by la_does_page_exist(), and la_log_record_process().

#define LA_REINIT_COMMIT_INTERVAL   10

Definition at line 105 of file log_applier.c.

Referenced by la_get_adaptive_time_commit_interval().

#define LA_REPL_LIST_COUNT   50

Definition at line 87 of file log_applier.c.

Referenced by la_init_repl_lists().

#define LA_SLEEP (   sec,
  usec 
)
Value:
do { \
struct timeval sleep_time_val; \
sleep_time_val.tv_sec = (sec); \
sleep_time_val.tv_usec = (usec); \
select (0, 0, 0, 0, &sleep_time_val); \
} while(0)

Definition at line 149 of file log_applier.c.

Referenced by la_apply_log_file(), la_apply_repl_log(), la_delay_replica(), la_find_log_pagesize(), la_lock_dbname(), and la_unlock_dbname().

#define LA_STATUS_BUSY   1

Definition at line 93 of file log_applier.c.

Referenced by la_check_time_commit(), and la_log_record_process().

#define LA_STATUS_IDLE   0

Definition at line 94 of file log_applier.c.

Referenced by la_check_time_commit(), la_get_ha_apply_info(), and la_log_record_process().

#define LA_WS_CULL_MOPS_INTERVAL   (180)

Definition at line 108 of file log_applier.c.

Referenced by la_commit_transaction().

#define LA_WS_CULL_MOPS_INTERVAL_MIN   (2)

Definition at line 110 of file log_applier.c.

Referenced by la_commit_transaction().

#define LA_WS_CULL_MOPS_PER_APPLY   (100000)

Definition at line 107 of file log_applier.c.

Referenced by la_commit_transaction().

#define LA_WS_CULL_MOPS_PER_APPLY_MIN   (100)

Definition at line 109 of file log_applier.c.

Referenced by la_commit_transaction().

#define SIZEOF_LA_CACHE_LOG_BUFFER (   io_pagesize)    (offsetof(LA_CACHE_BUFFER, logpage) + (io_pagesize))

Definition at line 117 of file log_applier.c.

Referenced by la_apply_log_file(), and la_cache_buffer_replace().

Typedef Documentation

typedef struct la_act_log LA_ACT_LOG

Definition at line 214 of file log_applier.c.

typedef struct la_apply LA_APPLY

Definition at line 253 of file log_applier.c.

typedef struct la_arv_log LA_ARV_LOG

Definition at line 225 of file log_applier.c.

Definition at line 176 of file log_applier.c.

Definition at line 189 of file log_applier.c.

typedef struct la_cache_pb LA_CACHE_PB

Definition at line 196 of file log_applier.c.

typedef struct la_commit LA_COMMIT

Definition at line 265 of file log_applier.c.

Definition at line 390 of file log_applier.c.

typedef struct la_info LA_INFO

Definition at line 278 of file log_applier.c.

typedef struct la_item LA_ITEM

Definition at line 235 of file log_applier.c.

Definition at line 354 of file log_applier.c.

Definition at line 370 of file log_applier.c.

Definition at line 362 of file log_applier.c.

Definition at line 379 of file log_applier.c.

Definition at line 205 of file log_applier.c.

Function Documentation

static int check_reinit_copylog ( void  )
static

Definition at line 7771 of file log_applier.c.

References la_info::act_log, ER_FAILED, error(), la_fetch_log_hdr(), la_act_log::log_hdr, log_header::mark_will_del, NO_ERROR, and la_info::reinit_copylog.

Referenced by la_apply_log_file(), and la_log_fetch_from_archive().

Here is the caller graph for this function:

static LA_APPLY* la_add_apply_list ( int  tranid)
static

Definition at line 2893 of file log_applier.c.

References la_info::cur_repl, i, la_find_apply_list(), la_init_repl_lists(), NO_ERROR, NULL, la_info::repl_cnt, la_info::repl_lists, and la_apply::tranid.

Referenced by la_log_record_process().

Here is the caller graph for this function:

static int la_add_node_into_la_commit_list ( int  tranid,
LOG_LSA lsa,
int  type,
time_t  eot_time 
)
static
static int la_add_repl_filter ( const char *  classname)
static
static void la_add_repl_item ( LA_APPLY apply,
LA_ITEM item 
)
static

Definition at line 3054 of file log_applier.c.

References assert, la_apply::head, la_item::next, NULL, la_apply::num_items, la_item::prev, and la_apply::tail.

Referenced by la_free_and_add_next_repl_item(), and la_set_repl_log().

Here is the caller graph for this function:

int la_apply_log_file ( const char *  database_name,
const char *  log_path,
const int  max_mem_size 
)

Definition at line 7810 of file log_applier.c.

References la_info::act_log, log_header::append_lsa, la_info::apply_state, ARG_FILE_LINE, assert, assert_release, log_rec_header::back_lsa, la_info::cache_buffer_size, la_info::cache_pb, check_reinit_copylog(), la_info::committed_lsa, la_info::committed_rep_lsa, CUB_MAXHOSTNAMELEN, la_act_log::db_iopagesize, la_info::db_lockf_vdes, la_act_log::db_logpagesize, DB_MAX_IDENTIFIER_LENGTH, log_header::eof_lsa, er_errid(), ER_ERROR_SEVERITY, ER_HA_GENERIC_ERROR, ER_HA_LA_EXCEED_MAX_MEM_SIZE, ER_HA_LA_INVALID_REPL_LOG_PAGEID_OFFSET, ER_HA_LA_REPL_FILTER_GENERIC, ER_HA_LA_STARTED, ER_HA_LA_STOPPED_BY_SIGNAL, ER_HB_PROCESS_EVENT, ER_LC_FAILED_TO_FLUSH_REPL_ITEMS, ER_LC_PARTIALLY_FAILED_TO_FLUSH, er_log_debug, ER_LOG_PAGE_CORRUPTED, ER_NET_CANT_CONNECT_SERVER, ER_OBJ_NO_CONNECT, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), er_stack_pop(), er_stack_push(), error(), fileio_make_log_info_name(), la_info::final_lsa, log_rec_header::forw_lsa, log_header::ha_file_status, HA_LOG_APPLIER_STATE_DONE, HA_LOG_APPLIER_STATE_RECOVERING, log_header::ha_server_state, HA_SERVER_STATE_ACTIVE, HA_SERVER_STATE_DEAD, HA_SERVER_STATE_TO_BE_STANDBY, hb_Proc_shutdown, log_page::hdr, i, la_info::is_end_of_record, tde_cipher::is_loaded, la_info::is_role_changed, la_applier_need_shutdown, la_applier_shutdown_by_signal, la_apply_pre(), la_change_state(), la_check_duplicated(), la_check_mem_size(), la_check_time_commit(), la_create_repl_filter(), la_decache_page_buffers(), la_delete_ha_apply_info(), la_does_page_exist(), la_enable_sql_logging, la_find_last_deleted_arv_num(), la_find_log_pagesize(), la_get_adaptive_time_commit_interval(), la_get_hostname_from_log_path(), la_get_last_ha_applied_info(), la_get_page_buffer(), LA_GET_PAGE_RETRY_COUNT, la_init(), la_init_cache_log_buffer(), la_init_cache_pb(), la_init_recdes_pool(), la_invalidate_page_buffer(), la_log_commit(), la_log_record_process(), LA_MAX_UNFLUSHED_REPL_ITEMS, LA_NUM_DELAY_HISTORY, LA_PAGE_DOESNOT_EXIST, la_peer_host, la_print_repl_filter_info(), la_release_all_page_buffers(), la_remove_archive_logs(), la_shutdown(), la_shutdown_by_signal(), la_slave_db_name, LA_SLEEP, la_unlock_dbname(), la_update_last_deleted_arv_num(), la_info::last_deleted_archive_num, la_info::last_time_archive_deleted, LOG_END_OF_LOG, LOG_GET_LOG_RECORD_HEADER, LOG_HA_FILESTAT_SYNCHRONIZED, la_act_log::log_hdr, la_info::log_path, la_info::log_path_lockf_vdes, log_hdrpage::logical_pageid, la_info::loginf_path, la_cache_buffer::logpage, LOGPAGEID_MAX, LSA_COPY(), LSA_EQ(), LSA_GE(), LSA_GT(), LSA_ISNULL(), LSA_SET_NULL(), NO_ERROR, NULL, NULL_OFFSET, NULL_PAGEID, log_header::nxarv_num, log_lsa::offset, log_hdrpage::offset, os_set_signal_handler(), log_lsa::pageid, la_cache_buffer::pageid, prm_get_bool_value(), prm_get_integer_value(), PRM_ID_HA_APPLYLOGDB_LOG_WAIT_TIME_IN_SECS, PRM_ID_HA_APPLYLOGDB_MAX_COMMIT_INTERVAL_IN_MSECS, PRM_ID_HA_REPL_FILTER_TYPE, PRM_ID_HA_SQL_LOGGING, PRM_ID_REMOVE_LOG_ARCHIVES_INTERVAL, la_info::reinit_copylog, REPL_FILTER_NONE, la_info::required_lsa, SIZEOF_LA_CACHE_LOG_BUFFER, sl_init(), tde_Cipher, and log_rec_header::type.

Referenced by applylogdb().

Here is the caller graph for this function:

static int la_apply_repl_log ( int  tranid,
int  rectype,
LOG_LSA commit_lsa,
int *  total_rows,
LOG_PAGEID  final_pageid 
)
static
static int la_apply_statement_log ( LA_ITEM item)
static

Definition at line 5413 of file log_applier.c.

References ARG_FILE_LINE, assert, au_find_user(), AU_SET_USER, Au_user, la_item::class_name, CUBRID_STMT_ALTER_CLASS, CUBRID_STMT_ALTER_INDEX, CUBRID_STMT_ALTER_SERIAL, CUBRID_STMT_ALTER_STORED_PROCEDURE, CUBRID_STMT_ALTER_USER, CUBRID_STMT_CREATE_CLASS, CUBRID_STMT_CREATE_INDEX, CUBRID_STMT_CREATE_SERIAL, CUBRID_STMT_CREATE_STORED_PROCEDURE, CUBRID_STMT_CREATE_TRIGGER, CUBRID_STMT_CREATE_USER, CUBRID_STMT_DELETE, CUBRID_STMT_DROP_CLASS, CUBRID_STMT_DROP_DATABASE, CUBRID_STMT_DROP_INDEX, CUBRID_STMT_DROP_LABEL, CUBRID_STMT_DROP_SERIAL, CUBRID_STMT_DROP_STORED_PROCEDURE, CUBRID_STMT_DROP_TRIGGER, CUBRID_STMT_DROP_USER, CUBRID_STMT_GRANT, CUBRID_STMT_INSERT, CUBRID_STMT_REMOVE_TRIGGER, CUBRID_STMT_RENAME_CLASS, CUBRID_STMT_RENAME_TRIGGER, CUBRID_STMT_REVOKE, CUBRID_STMT_SET_TRIGGER, CUBRID_STMT_TRUNCATE, CUBRID_STMT_UPDATE, CUBRID_STMT_UPDATE_STATS, db_get_string(), db_reset_system_parameters_from_assignments(), db_set_system_parameters_for_ha_repl(), la_item::db_user, la_info::delete_counter, er_errid(), ER_ERROR_SEVERITY, ER_HA_GENERIC_ERROR, ER_HA_LA_FAILED_TO_APPLY_STATEMENT, er_log_debug, er_msg(), ER_NET_CANT_CONNECT_SERVER, ER_OBJ_NO_CONNECT, er_set(), er_stack_pop(), er_stack_push(), error(), la_info::fail_counter, la_item::ha_sys_prm, la_info::insert_counter, la_item::item_type, la_item::key, la_enable_sql_logging, la_flush_repl_items(), la_need_filter_out(), la_update_query_execute(), NO_ERROR, NULL, la_info::schema_counter, sl_write_statement_sql(), and la_info::update_counter.

Referenced by la_apply_repl_log().

Here is the caller graph for this function:

static RECDES * la_assign_recdes_from_pool ( void  )
static
static LA_CACHE_BUFFER * la_cache_buffer_replace ( LA_CACHE_PB cache_pb,
LOG_PAGEID  pageid,
int  io_pagesize,
int  buffer_size 
)
static
static int la_check_duplicated ( const char *  logpath,
const char *  dbname,
int *  lockf_vdes,
int *  last_deleted_arv_num 
)
static
static int la_check_time_commit ( struct timeval *  time,
unsigned int  threshold 
)
static
static void la_clear_all_repl_and_commit_list ( void  )
static

Definition at line 3396 of file log_applier.c.

References la_info::cur_repl, i, la_free_repl_items_by_tranid(), la_info::repl_lists, and la_apply::tranid.

Referenced by la_change_state().

Here is the caller graph for this function:

static void la_clear_applied_info ( LA_APPLY apply)
static

Definition at line 3382 of file log_applier.c.

References assert, la_free_all_repl_items(), la_apply::last_lsa, LSA_SET_NULL(), la_apply::start_lsa, and la_apply::tranid.

Referenced by la_apply_repl_log(), and la_free_repl_items_by_tranid().

Here is the caller graph for this function:

static void la_clear_recdes_pool ( void  )
static
static void la_decache_page_buffers ( LOG_PAGEID  from,
LOG_PAGEID  to 
)
static
static void la_destroy_repl_filter ( void  )
static

Definition at line 7745 of file log_applier.c.

References free_and_init, i, la_repl_filter::list, la_repl_filter::list_size, NULL, la_repl_filter::num_filters, and la_info::repl_filter.

Referenced by la_create_repl_filter(), and la_shutdown().

Here is the caller graph for this function:

static int la_expand_cache_log_buffer ( LA_CACHE_PB cache_pb,
int  slb_cnt,
int  slb_size 
)
static
static int la_fetch_log_hdr ( LA_ACT_LOG act_log)
static
static LA_APPLY * la_find_apply_list ( int  tranid)
static

Definition at line 2864 of file log_applier.c.

References la_info::cur_repl, i, NULL, la_info::repl_lists, and la_apply::tranid.

Referenced by la_add_apply_list(), la_apply_repl_log(), la_free_repl_items_by_tranid(), and la_set_repl_log().

Here is the caller graph for this function:

static int la_find_last_deleted_arv_num ( void  )
static
static int la_find_required_lsa ( LOG_LSA required_lsa)
static

Definition at line 1462 of file log_applier.c.

References la_info::cur_repl, error(), la_info::final_lsa, i, LSA_COPY(), LSA_GT(), LSA_ISNULL(), LSA_SET_NULL(), NO_ERROR, la_info::repl_lists, la_apply::start_lsa, and la_apply::tranid.

Referenced by la_log_commit().

Here is the caller graph for this function:

bool la_force_shutdown ( void  )

Definition at line 591 of file log_applier.c.

References la_applier_need_shutdown, and la_applier_shutdown_by_signal.

Referenced by applylogdb().

Here is the caller graph for this function:

static void la_free_all_repl_items ( LA_APPLY apply)
static
static void la_free_all_repl_items_except_head ( LA_APPLY apply)
static

Definition at line 3304 of file log_applier.c.

References assert, la_apply::head, la_free_repl_item(), la_item::next, and NULL.

Referenced by la_free_all_repl_items(), and la_set_repl_log().

Here is the caller graph for this function:

static void la_free_and_add_next_repl_item ( LA_APPLY apply,
LA_ITEM next_item,
LOG_LSA lsa 
)
static

Definition at line 3331 of file log_applier.c.

References assert, la_apply::head, la_apply::is_long_trans, la_add_repl_item(), la_free_repl_item(), la_item::lsa, LSA_ISNULL(), LSA_LT(), la_item::next, and NULL.

Referenced by la_apply_repl_log().

Here is the caller graph for this function:

static void la_free_repl_items_by_tranid ( int  tranid)
static
static void la_get_adaptive_time_commit_interval ( int *  time_commit_interval,
int *  delay_hist 
)
static
static float la_get_avg ( int *  array,
int  size 
)
static

Definition at line 7406 of file log_applier.c.

References assert, and i.

Referenced by la_get_adaptive_time_commit_interval().

Here is the caller graph for this function:

static int la_get_ha_apply_info ( const char *  log_path,
const char *  prefix_name,
LA_HA_APPLY_INFO ha_apply_info 
)
static
static LOG_REC_HA_SERVER_STATE* la_get_ha_server_state ( LOG_PAGE pgptr,
LOG_LSA lsa 
)
static

Definition at line 4654 of file log_applier.c.

References log_page::area, DB_SIZEOF, error(), LA_LOG_READ_ADVANCE_WHEN_DOESNT_FIT, NO_ERROR, NULL, log_lsa::offset, log_lsa::pageid, and la_cache_buffer::pageid.

Referenced by la_log_record_process().

Here is the caller graph for this function:

static char * la_get_hostname_from_log_path ( char *  log_path)
static

Definition at line 6252 of file log_applier.c.

References la_slave_db_name, NULL, p, and strlen.

Referenced by la_apply_log_file().

Here is the caller graph for this function:

static unsigned long la_get_mem_size ( void  )
static

Definition at line 6479 of file log_applier.c.

References NULL, ONE_K, and pid.

Referenced by la_check_mem_size(), and la_init().

Here is the caller graph for this function:

static LA_ITEM * la_get_next_repl_item ( LA_ITEM item,
bool  is_long_trans,
LOG_LSA last_lsa 
)
static

Definition at line 5922 of file log_applier.c.

References la_get_next_repl_item_from_list(), and la_get_next_repl_item_from_log().

Referenced by la_apply_repl_log().

Here is the caller graph for this function:

static LA_ITEM * la_get_next_repl_item_from_list ( LA_ITEM item)
static

Definition at line 5935 of file log_applier.c.

References la_item::next.

Referenced by la_get_next_repl_item().

Here is the caller graph for this function:

static LOG_PAGE * la_get_page ( LOG_PAGEID  pageid)
static
static int la_get_relocation_recdes ( LOG_RECORD_HEADER lrec,
LOG_PAGE pgptr,
unsigned int  match_rcvindex,
void **  logs,
char **  rec_type,
RECDES recdes 
)
static
int la_get_undoredo_diff ( LOG_PAGE **  pgptr,
LOG_PAGEID pageid,
PGLENGTH offset,
bool is_undo_zip,
char **  undo_data,
int *  undo_length 
)
static
char * la_get_zipped_data ( char *  undo_data,
int  undo_length,
bool  is_diff,
bool  is_undo_zip,
bool  is_overflow,
char **  rec_type,
char **  data,
int *  length 
)
static
static bool la_ignore_on_error ( int  errid)
static

Definition at line 2247 of file log_applier.c.

References assert_release, NO_ERROR, PRM_ID_HA_APPLYLOGDB_IGNORE_ERROR_LIST, and sysprm_find_err_in_integer_list().

Referenced by la_apply_repl_log(), and la_restart_on_bulk_flush_error().

Here is the caller graph for this function:

static int la_init_cache_log_buffer ( LA_CACHE_PB cache_pb,
int  slb_cnt,
int  slb_size 
)
static
static LA_CACHE_PB * la_init_cache_pb ( void  )
static
static void la_init_ha_apply_info ( LA_HA_APPLY_INFO ha_apply_info)
static
static void la_invalidate_page_buffer ( LA_CACHE_BUFFER cache_buffer)
static

Definition at line 1409 of file log_applier.c.

References la_info::cache_pb, la_cache_buffer::fix_count, la_cache_pb::hash_table, mht_rem(), NULL, la_cache_buffer::pageid, and la_cache_buffer::recently_free.

Referenced by la_apply_log_file(), and la_does_page_exist().

Here is the caller graph for this function:

static bool la_is_repl_lists_empty ( )
static

Definition at line 2841 of file log_applier.c.

References la_info::cur_repl, i, la_apply::num_items, and la_info::repl_lists.

Referenced by la_log_record_process().

Here is the caller graph for this function:

static int la_lock_dbname ( int *  lockf_vdes,
char *  db_name,
char *  log_path 
)
static

Definition at line 6724 of file log_applier.c.

References assert_release, error(), fileio_lock_la_dbname(), FILEIO_LOCKF, la_info::is_role_changed, LA_SLEEP, NO_ERROR, and NULL_VOLDES.

Referenced by la_apply_repl_log().

Here is the caller graph for this function:

static void la_log_copy_fromlog ( char *  rec_type,
char *  area,
int  length,
LOG_PAGEID  log_pageid,
PGLENGTH  log_offset,
LOG_PAGE log_pgptr 
)
static

Definition at line 2964 of file log_applier.c.

References DB_SIZEOF, error(), LA_LOG_READ_ADVANCE_WHEN_DOESNT_FIT, LA_LOGAREA_SIZE, NO_ERROR, and NULL.

Referenced by la_get_log_data(), la_get_next_update_log(), la_get_undoredo_diff(), and la_make_repl_item().

Here is the caller graph for this function:

static int la_log_io_open ( const char *  vlabel,
int  flags,
int  mode 
)
static
static int la_log_io_read ( char *  vname,
int  vdes,
void *  io_pgptr,
LOG_PHY_PAGEID  pageid,
int  pagesize 
)
static

Definition at line 668 of file log_applier.c.

References la_log_io_read_with_max_retries().

Referenced by la_fetch_log_hdr(), la_find_log_pagesize(), la_log_fetch(), and la_log_page_check().

Here is the caller graph for this function:

static int la_log_io_read_with_max_retries ( char *  vname,
int  vdes,
void *  io_pgptr,
LOG_PHY_PAGEID  pageid,
int  pagesize,
int  retries 
)
static
int la_log_page_check ( const char *  database_name,
const char *  log_path,
INT64  page_num,
bool  check_applied_info,
bool  check_copied_info,
bool  check_replica_info,
bool  verbose,
LOG_LSA copied_eof_lsa,
LOG_LSA copied_append_lsa,
LOG_LSA applied_final_lsa 
)

Definition at line 7046 of file log_applier.c.

References la_info::act_log, log_header::append_lsa, la_ha_apply_info::append_lsa, ARG_FILE_LINE, la_info::arv_log, assert, log_rec_header::back_lsa, la_ha_apply_info::commit_counter, la_ha_apply_info::committed_lsa, la_ha_apply_info::committed_rep_lsa, la_ha_apply_info::creation_time, db_datetime::date, db_datetime_to_string(), db_datetime_to_string2(), db_error_string(), la_act_log::db_iopagesize, la_act_log::db_logpagesize, la_ha_apply_info::delete_counter, log_header::eof_lsa, la_ha_apply_info::eof_lsa, ER_ERROR_SEVERITY, ER_HA_GENERIC_ERROR, ER_LOG_MOUNT_FAIL, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), er_set_with_oserror(), error(), la_ha_apply_info::fail_counter, fileio_is_volume_exist(), fileio_make_log_active_name(), la_ha_apply_info::final_lsa, log_rec_header::forw_lsa, free_and_init, log_page::hdr, if(), la_ha_apply_info::insert_counter, la_find_last_deleted_arv_num(), la_find_log_pagesize(), la_get_ha_apply_info(), la_init(), la_init_ha_apply_info(), la_log_fetch_from_archive(), la_log_io_read(), LA_LOG_IS_IN_ARCHIVE, la_log_phypageid(), la_print_log_arv_header(), la_print_log_header(), la_ha_apply_info::last_access_time, la_info::last_deleted_archive_num, la_ha_apply_info::log_commit_time, la_info::log_data, LOG_GET_LOG_RECORD_HEADER, la_act_log::log_hdr, la_arv_log::log_hdr, LOG_IS_PAGE_TDE_ENCRYPTED, la_info::log_path, la_ha_apply_info::log_record_time, la_act_log::log_vdes, log_hdrpage::logical_pageid, la_cache_buffer::logpage, LSA_AS_ARGS, LSA_COPY(), NO_ERROR, NULL, log_lsa::offset, log_hdrpage::offset, log_lsa::pageid, la_act_log::path, prm_get_integer_value(), prm_get_string_value(), PRM_ID_HA_REPLICA_DELAY_IN_SECS, PRM_ID_HA_REPLICA_TIME_BOUND, la_ha_apply_info::required_lsa, la_ha_apply_info::schema_counter, la_ha_apply_info::start_time, tde_decrypt_log_page(), db_datetime::time, log_rec_header::trid, log_rec_header::type, and la_ha_apply_info::update_counter.

Referenced by applyinfo().

Here is the caller graph for this function:

static LOG_PHY_PAGEID la_log_phypageid ( LOG_PAGEID  logical_pageid)
static

Definition at line 621 of file log_applier.c.

References la_info::act_log, assert, log_header::fpageid, la_act_log::log_hdr, LOGPB_HEADER_PAGE_ID, log_header::npages, PAGEID_MAX, and la_cache_buffer::phy_pageid.

Referenced by la_log_fetch(), and la_log_page_check().

Here is the caller graph for this function:

static int la_log_record_process ( LOG_RECORD_HEADER lrec,
LOG_LSA final,
LOG_PAGE pg_ptr 
)
static

Definition at line 5999 of file log_applier.c.

References ARG_FILE_LINE, assert, log_rec_ha_server_state::at_time, log_rec_header::back_lsa, la_info::commit_counter, la_info::committed_lsa, css_ha_server_state_string(), la_info::db_lockf_vdes, er_errid(), ER_ERROR_SEVERITY, ER_FAILED, ER_HA_GENERIC_ERROR, ER_HA_LA_EXCEED_MAX_MEM_SIZE, ER_HA_LA_INVALID_REPL_LOG_RECORD, ER_HA_LA_UNEXPECTED_EOF_IN_ARCHIVE_LOG, ER_INTERRUPTED, ER_LC_FAILED_TO_FLUSH_REPL_ITEMS, ER_LC_PARTIALLY_FAILED_TO_FLUSH, ER_LK_UNILATERALLY_ABORTED, er_log_debug, ER_LOG_PAGE_CORRUPTED, ER_NET_CANT_CONNECT_SERVER, ER_NET_SERVER_COMM_ERROR, ER_NOTIFICATION_SEVERITY, er_set(), ER_TDE_CIPHER_IS_NOT_LOADED, ER_TM_SERVER_DOWN_UNILATERALLY_ABORTED, error(), log_rec_header::forw_lsa, HA_SERVER_STATE_ACTIVE, HA_SERVER_STATE_TO_BE_STANDBY, log_page::hdr, la_info::is_end_of_record, la_info::is_role_changed, la_add_apply_list(), la_add_node_into_la_commit_list(), la_applier_need_shutdown, la_apply_commit_list(), la_delay_replica(), la_does_page_exist(), la_free_repl_items_by_tranid(), la_get_ha_server_state(), la_is_repl_lists_empty(), la_log_commit(), LA_PAGE_EXST_IN_ARCHIVE_LOG, la_peer_host, la_retrieve_eot_time(), la_set_repl_log(), la_slave_db_name, LA_STATUS_BUSY, LA_STATUS_IDLE, la_update_ha_apply_info_log_record_time(), LOG_ABORT, LOG_COMMIT, LOG_DUMMY_CRASH_RECOVERY, LOG_DUMMY_HA_SERVER_STATE, LOG_END_CHKPT, LOG_END_OF_LOG, LOG_LARGER_LOGREC_TYPE, LOG_REPLICATION_DATA, LOG_REPLICATION_STATEMENT, LOG_SMALLER_LOGREC_TYPE, LOG_SYSOP_END, LOG_SYSTEM_TRANID, log_hdrpage::logical_pageid, LSA_COPY(), LSA_GT(), LSA_ISNULL(), NO_ERROR, NULL, NULL_PAGEID, NULL_TRANID, NULL_VOLDES, log_lsa::offset, log_lsa::pageid, log_rec_header::prev_tranlsa, snprintf_dots_truncate, la_apply::start_lsa, log_rec_ha_server_state::state, la_info::status, log_rec_header::trid, and log_rec_header::type.

Referenced by la_apply_log_file().

Here is the caller graph for this function:

static void la_make_room_for_mvcc_insid ( RECDES recdes)
static
void la_print_delay_info ( LOG_LSA  working_lsa,
LOG_LSA  target_lsa,
float  process_rate 
)

Definition at line 7269 of file log_applier.c.

References log_lsa::pageid.

Referenced by applyinfo().

Here is the caller graph for this function:

void la_print_log_arv_header ( const char *  database_name,
LOG_ARV_HEADER hdr,
bool  verbose 
)
static int la_realloc_recdes_data ( RECDES recdes,
int  data_size 
)
static
static void la_release_all_page_buffers ( LOG_PAGEID  except_pageid)
static
int la_remove_archive_logs ( const char *  db_name,
int  last_deleted_arv_num,
int  nxarv_num,
int  max_arv_count_to_delete 
)
static
static bool la_restart_on_bulk_flush_error ( int  errid)
static

Definition at line 2271 of file log_applier.c.

References la_ignore_on_error(), and la_retry_on_error().

Referenced by la_flush_repl_items().

Here is the caller graph for this function:

static time_t la_retrieve_eot_time ( LOG_PAGE pgptr,
LOG_LSA lsa 
)
static
static bool la_retry_on_error ( int  errid)
static

Definition at line 2282 of file log_applier.c.

References assert_release, LA_RETRY_ON_ERROR, NO_ERROR, PRM_ID_HA_APPLYLOGDB_RETRY_ERROR_LIST, and sysprm_find_err_in_integer_list().

Referenced by la_apply_repl_log(), and la_restart_on_bulk_flush_error().

Here is the caller graph for this function:

static int la_set_repl_log ( LOG_PAGE log_pgptr,
int  log_type,
int  tranid,
LOG_LSA lsa 
)
static
static void la_shutdown_by_signal ( int  ignore)
static

Definition at line 583 of file log_applier.c.

References la_applier_need_shutdown, and la_applier_shutdown_by_signal.

Referenced by la_apply_log_file().

Here is the caller graph for this function:

static void la_unlink_repl_item ( LA_APPLY apply,
LA_ITEM item 
)
static

Definition at line 3232 of file log_applier.c.

References assert, la_apply::head, la_item::next, NULL, la_apply::num_items, la_item::prev, and la_apply::tail.

Referenced by la_free_repl_item().

Here is the caller graph for this function:

static int la_unlock_dbname ( int *  lockf_vdes,
char *  db_name,
bool  clear_owner 
)
static

Definition at line 6754 of file log_applier.c.

References ER_FAILED, error(), FILEIO_LOCKF, fileio_unlock_la_dbname(), la_info::is_role_changed, LA_SLEEP, NO_ERROR, and NULL_VOLDES.

Referenced by la_apply_log_file(), and la_shutdown().

Here is the caller graph for this function:

static int la_update_last_deleted_arv_num ( int  lockf_vdes,
int  last_deleted_arv_num 
)
static

Definition at line 6696 of file log_applier.c.

References assert, ER_FAILED, NO_ERROR, and NULL_VOLDES.

Referenced by la_apply_log_file().

Here is the caller graph for this function:

static int la_update_query_execute ( const char *  sql,
bool  au_disable 
)
static

Definition at line 5329 of file log_applier.c.

References ARG_FILE_LINE, AU_DISABLE, AU_ENABLE, db_execute(), db_query_end(), er_log_debug, error(), and NO_ERROR.

Referenced by la_apply_statement_log().

Here is the caller graph for this function:

static int la_update_query_execute_with_values ( const char *  sql,
int  arg_count,
DB_VALUE vals,
bool  au_disable 
)
static
static unsigned int log_pageid_hash ( const void *  key,
unsigned int  htsize 
)
static

Definition at line 2504 of file log_applier.c.

References assert, LOGPB_HEADER_PAGE_ID, and NULL.

Referenced by la_init_cache_log_buffer().

Here is the caller graph for this function:

Variable Documentation

bool la_applier_shutdown_by_signal = false
static

Definition at line 421 of file log_applier.c.

Referenced by la_apply_log_file(), la_force_shutdown(), and la_shutdown_by_signal().

bool la_enable_sql_logging = false
static
LA_INFO la_Info

Definition at line 416 of file log_applier.c.

char la_peer_host[CUB_MAXHOSTNAMELEN+1]
static

Definition at line 423 of file log_applier.c.

Referenced by la_apply_log_file(), la_change_state(), and la_log_record_process().

Definition at line 418 of file log_applier.c.