Skip to content

File log_applier.c

FileList > cubrid > src > transaction > log_applier.c

Go to the source code of this file

  • #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 "object_primitive.h"
  • #include "object_representation.h"
  • #include "db_value_printer.hpp"
  • #include "db.h"
  • #include "object_accessor.h"
  • #include "locator_cl.h"
  • #include "network_interface_cl.h"
  • #include "schema_system_catalog_constants.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"

Classes

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

Public Types

Type Name
typedef struct la_act_log LA_ACT_LOG
typedef struct la_apply LA_APPLY
typedef struct la_arv_log LA_ARV_LOG
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_commit LA_COMMIT
typedef struct la_ha_apply_info LA_HA_APPLY_INFO
typedef struct la_info LA_INFO
typedef struct la_item LA_ITEM
typedef struct la_ovf_first_part LA_OVF_FIRST_PART
typedef struct la_ovf_page_list LA_OVF_PAGE_LIST
typedef struct la_ovf_rest_parts LA_OVF_REST_PARTS
typedef struct la_recdes_pool LA_RECDES_POOL
typedef struct la_repl_filter LA_REPL_FILTER

Public Attributes

Type Name
LA_INFO la_Info
LA_RECDES_POOL la_recdes_pool

Public Static Attributes

Type Name
bool la_applier_need_shutdown = [**false**](broker__monitor_8c.md#function-timeout)
bool la_applier_shutdown_by_signal = [**false**](broker__monitor_8c.md#function-timeout)
bool la_enable_sql_logging = [**false**](broker__monitor_8c.md#function-timeout)
char la_peer_host
char la_slave_db_name

Public Functions

Type Name
int la_apply_log_file (const char * database_name, const char * log_path, const int max_mem_size)
void la_dump_la_act_log (FILE * out, int indent)
void la_dump_la_apply (FILE * out, int idx, int indent)
void la_dump_la_apply_list (FILE * out, int indent)
void la_dump_la_arv_log (FILE * out, int indent)
void la_dump_la_info (FILE * out)
bool la_force_shutdown (void)
int la_get_applied_log_info (const char * database_name, const char * log_path, bool check_replica_info, bool verbose, LOG_LSA * applied_final_lsa)
int la_get_copied_log_info (const char * database_name, const char * log_path, INT64 page_num, bool verbose, LOG_LSA * copied_eof_lsa, LOG_LSA * copied_append_lsa)
void la_print_delay_info (LOG_LSA working_lsa, LOG_LSA target_lsa, float process_rate)
void la_print_log_arv_header (const char * database_name, LOG_ARV_HEADER * hdr, bool verbose)
void la_print_log_header (const char * database_name, LOG_HEADER * hdr, bool verbose)

Public Static Functions

Type Name
int check_reinit_copylog (void)
LA_APPLY * la_add_apply_list (int tranid)
int la_add_node_into_la_commit_list (int tranid, LOG_LSA * lsa, int type, time_t eot_time)
int la_add_repl_filter (const char * classname)
void la_add_repl_item (LA_APPLY * apply, LA_ITEM * item)
int la_apply_commit_list (LOG_LSA * lsa, LOG_PAGEID final_pageid)
int la_apply_delete_log (LA_ITEM * item)
int la_apply_insert_log (LA_ITEM * item)
bool la_apply_pre (void)
int la_apply_repl_log (int tranid, int rectype, LOG_LSA * commit_lsa, int * total_rows, LOG_PAGEID final_pageid)
int la_apply_statement_log (LA_ITEM * item)
int la_apply_update_log (LA_ITEM * item)
RECDES * la_assign_recdes_from_pool (void)
LA_CACHE_BUFFER * la_cache_buffer_replace (LA_CACHE_PB * cache_pb, LOG_PAGEID pageid, int io_pagesize, int buffer_size)
int la_change_state (void)
int la_check_duplicated (const char * logpath, const char * dbname, int * lockf_vdes, int * last_deleted_arv_num)
int la_check_mem_size (void)
int la_check_time_commit (struct timeval * time, unsigned int threshold)
void la_clear_all_repl_and_commit_list (void)
void la_clear_applied_info (LA_APPLY * apply)
void la_clear_recdes_pool (void)
int la_commit_transaction (void)
void la_count_repl_lists (const LA_INFO * info, int * active_repl_count, int * long_repl_count, int * active_repl_item_count)
int la_create_repl_filter (void)
void la_decache_page_buffers (LOG_PAGEID from, LOG_PAGEID to)
int la_delay_replica (time_t eot_time)
int la_delete_ha_apply_info (void)
void la_destroy_repl_filter (void)
int la_disk_to_obj (MOBJ classobj, RECDES * record, DB_OTMPL * def, DB_VALUE * key)
int la_does_page_exist (LOG_PAGEID pageid)
void la_dump_repl_filter (FILE * out, const LA_REPL_FILTER * filter, int indent)
int la_expand_cache_log_buffer (LA_CACHE_PB * cache_pb, int slb_cnt, int slb_size)
int la_fetch_log_hdr (LA_ACT_LOG * act_log)
LA_APPLY * la_find_apply_list (int tranid)
int la_find_archive_num (int * arv_log_num, LOG_PAGEID pageid)
int la_find_last_deleted_arv_num (void)
int la_find_log_pagesize (LA_ACT_LOG * act_log, const char * logpath, const char * dbname, bool check_charset)
int la_find_required_lsa (LOG_LSA * required_lsa)
int la_flush_repl_items (bool immediate)
void la_free_all_repl_items (LA_APPLY * apply)
void la_free_all_repl_items_except_head (LA_APPLY * apply)
void la_free_and_add_next_repl_item (LA_APPLY * apply, LA_ITEM * next_item, LOG_LSA * lsa)
void la_free_repl_item (LA_APPLY * apply, LA_ITEM * item)
void la_free_repl_items_by_tranid (int tranid)
void la_get_adaptive_time_commit_interval (int * time_commit_interval, int * delay_hist)
float la_get_avg (int * array, int size)
int la_get_current (OR_BUF * buf, SM_CLASS * sm_class, int bound_bit_flag, DB_OTMPL * def, DB_VALUE * key, int offset_size)
int la_get_ha_apply_info (const char * log_path, const char * prefix_name, LA_HA_APPLY_INFO * ha_apply_info)
LOG_REC_HA_SERVER_STATE * la_get_ha_server_state (LOG_PAGE * pgptr, LOG_LSA * lsa)
char * la_get_hostname_from_log_path (char * log_path)
DB_VALUE * la_get_item_pk_value (LA_ITEM * item)
int la_get_last_ha_applied_info (void)
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)
unsigned long la_get_mem_size (void)
LA_ITEM * la_get_next_repl_item (LA_ITEM * item, bool is_long_trans, LOG_LSA * last_lsa)
LA_ITEM * la_get_next_repl_item_from_list (LA_ITEM * item)
LA_ITEM * la_get_next_repl_item_from_log (LA_ITEM * item, LOG_LSA * last_lsa)
int la_get_next_update_log (LOG_RECORD_HEADER * prev_lrec, LOG_PAGE * pgptr, void ** logs, char ** rec_type, char ** data, int * d_length)
int la_get_overflow_recdes (LOG_RECORD_HEADER * lrec, void * logs, RECDES * recdes, unsigned int rcvindex)
LOG_PAGE * la_get_page (LOG_PAGEID pageid)
LA_CACHE_BUFFER * la_get_page_buffer (LOG_PAGEID pageid)
int la_get_range_of_archive (int arv_log_num, LOG_PAGEID * fpageid, DKNPAGES * npages)
int la_get_recdes (LOG_LSA * lsa, LOG_PAGE * pgptr, RECDES * recdes, unsigned int * rcvindex, char * rec_type, bool is_mvcc_class)
int la_get_relocation_recdes (LOG_RECORD_HEADER * lrec, LOG_PAGE * pgptr, unsigned int match_rcvindex, void ** logs, char ** rec_type, RECDES * recdes)
int la_get_undoredo_diff (LOG_PAGE ** pgptr, LOG_PAGEID * pageid, PGLENGTH * offset, bool * is_undo_zip, char ** undo_data, int * undo_length)
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)
bool la_ignore_on_error (int errid)
void la_init (const char * log_path, const int max_mem_size)
int la_init_cache_log_buffer (LA_CACHE_PB * cache_pb, int slb_cnt, int slb_size)
LA_CACHE_PB * la_init_cache_pb (void)
void la_init_delay_history (int * delay_history)
void la_init_ha_apply_info (LA_HA_APPLY_INFO * ha_apply_info)
int la_init_recdes_pool (int page_size, int num_recdes)
int la_init_repl_lists (bool need_realloc)
int la_insert_ha_apply_info (DB_DATETIME * creation_time)
void la_invalidate_page_buffer (LA_CACHE_BUFFER * cache_buffer)
bool la_is_mvcc_class (const OID * class_oid)
bool la_is_repl_lists_empty ()
int la_lock_dbname (int * lockf_vdes, char * db_name, char * log_path)
void la_log_apply_error (const char * op_name, int err_id, LA_ITEM * item, int error)
int la_log_commit (bool update_commit_time)
void la_log_copy_fromlog (char * rec_type, char * area, int * length, LOG_PAGEID log_pageid, PGLENGTH log_offset, LOG_PAGE * log_pgptr)
int la_log_fetch (LOG_PAGEID pageid, LA_CACHE_BUFFER * cache_buffer)
int la_log_fetch_from_archive (LOG_PAGEID pageid, char * data)
int la_log_io_open (const char * vlabel, int flags, int mode)
int la_log_io_read (char * vname, int vdes, void * io_pgptr, LOG_PHY_PAGEID pageid, int pagesize)
int la_log_io_read_with_max_retries (char * vname, int vdes, void * io_pgptr, LOG_PHY_PAGEID pageid, int pagesize, int retries)
LOG_PHY_PAGEID la_log_phypageid (LOG_PAGEID logical_pageid)
int la_log_record_process (LOG_RECORD_HEADER * lrec, LOG_LSA * final, LOG_PAGE * pg_ptr)
LA_ITEM * la_make_repl_item (LOG_PAGE * log_pgptr, int log_type, int tranid, LOG_LSA * lsa)
void la_make_room_for_mvcc_delid_and_prev_ver (RECDES * recdes)
void la_make_room_for_mvcc_insid (RECDES * recdes)
bool la_need_filter_out (LA_ITEM * item)
LA_ITEM * la_new_repl_item (LOG_LSA * lsa, LOG_LSA * target_lsa)
void la_print_repl_filter_info (void)
int la_realloc_recdes_data (RECDES * recdes, int data_size)
void la_release_all_page_buffers (LOG_PAGEID except_pageid)
void la_release_page_buffer (LOG_PAGEID pageid)
int la_remove_archive_logs (const char * db_name, int last_deleted_arv_num, int nxarv_num, int max_arv_count_to_delete)
int la_repl_add_object (MOP classop, LA_ITEM * item, RECDES * recdes)
const char * la_repl_filter_type_string (REPL_FILTER_TYPE type)
bool la_restart_on_bulk_flush_error (int errid)
time_t la_retrieve_eot_time (LOG_PAGE * pgptr, LOG_LSA * lsa)
bool la_retry_on_error (int errid)
void la_set_error_sql_log (const char * class_name, DB_VALUE * key_val)
void la_set_peer_host (char * dest, const char * src)
int la_set_repl_log (LOG_PAGE * log_pgptr, int log_type, int tranid, LOG_LSA * lsa)
void la_set_slave_db_name (char * dest, const char * src)
void la_shutdown (void)
void la_shutdown_by_signal (int ignore)
void la_unlink_repl_item (LA_APPLY * apply, LA_ITEM * item)
int la_unlock_dbname (int * lockf_vdes, char * db_name, bool clear_owner)
int la_update_ha_apply_info_log_record_time (time_t new_time)
int la_update_ha_apply_info_start_time (void)
int la_update_ha_last_applied_info (void)
int la_update_last_deleted_arv_num (int lockf_vdes, int last_deleted_arv_num)
int la_update_query_execute (const char * sql, bool au_disable)
int la_update_query_execute_with_values (const char * sql, int arg_count, DB_VALUE * vals, bool au_disable)
int la_write_delete_sql_log (LA_ITEM * item, DB_OBJECT * class_obj)
int la_write_insert_sql_log (LA_ITEM * item, DB_OBJECT * class_obj, RECDES * recdes)
int la_write_update_sql_log (LA_ITEM * item, DB_OBJECT * class_obj, RECDES * recdes)
unsigned int log_pageid_hash (const void * key, unsigned int htsize)

Macros

Type Name
define LA_DEFAULT_CACHE_BUFFER_SIZE 100
define LA_DEFAULT_LOG_PAGE_SIZE 4096
define LA_GET_PAGE_RETRY_COUNT 10
define LA_IN_VALUE_COUNT 2
define LA_IN_VALUE_COUNT 2
define LA_IN_VALUE_COUNT 2
define LA_IN_VALUE_COUNT 2
define LA_IN_VALUE_COUNT 2
define LA_IN_VALUE_COUNT 2
define LA_IS_FLUSH_ERROR (err) (([**err**](porting_8h.md#define-err)) == [**ER\_LC\_PARTIALLY\_FAILED\_TO\_FLUSH**](error__code_8h.md#define-er_lc_partially_failed_to_flush) \|\| ([**err**](porting_8h.md#define-err)) == [**ER\_LC\_FAILED\_TO\_FLUSH\_REPL\_ITEMS**](error__code_8h.md#define-er_lc_failed_to_flush_repl_items))
define LA_LOCK_SUFFIX "\_lgla\_\_lock"
define LA_LOGAREA_SIZE (la\_Info.act\_log.db\_logpagesize - [**SSIZEOF**](broker__monitor_8c.md#function-timeout)([**LOG\_HDRPAGE**](log__storage_8hpp.md#typedef-log_hdrpage)))
define LA_LOG_IS_IN_ARCHIVE (pageid) ((pageid) &lt; la\_Info.act\_log.log\_hdr-&gt;nxarv\_pageid)
define LA_LOG_READ_ADD_ALIGN (result, add, offset, pageid, log_pgptr) /* multi line expression */
define LA_LOG_READ_ADVANCE_WHEN_DOESNT_FIT (result, length, offset, pageid, pgptr) /* multi line expression */
define LA_LOG_READ_ALIGN (result, offset, pageid, log_pgptr) /* multi line expression */
define LA_MAX_REPL_ITEMS 1000
define LA_MAX_REPL_ITEM_WITHOUT_RELEASE_PB 50
define LA_MAX_TOLERABLE_DELAY 2
define LA_MAX_UNFLUSHED_REPL_ITEMS 200
define LA_MOVE_INSIDE_RECORD (rec, dest_offset, src_offset) /* multi line expression */
define LA_NUM_DELAY_HISTORY 10
define LA_NUM_REPL_FILTER 50
define LA_OUT_VALUE_COUNT 23
define LA_PAGE_DOESNOT_EXIST 0
define LA_PAGE_EXST_IN_ACTIVE_LOG 1
define LA_PAGE_EXST_IN_ARCHIVE_LOG 2
define LA_QUERY_BUF_SIZE 2048
define LA_REINIT_COMMIT_INTERVAL 10
define LA_REPL_LIST_COUNT 50
define LA_SLEEP (sec, usec) /* multi line expression */
define LA_STATUS_BUSY 1
define LA_STATUS_IDLE 0
define LA_WS_CULL_MOPS_INTERVAL (180)
define LA_WS_CULL_MOPS_INTERVAL_MIN (2)
define LA_WS_CULL_MOPS_PER_APPLY (100000)
define LA_WS_CULL_MOPS_PER_APPLY_MIN (100)
define SIZEOF_LA_CACHE_LOG_BUFFER (io_pagesize) ([**offsetof**](broker__monitor_8c.md#function-timeout)([**LA\_CACHE\_BUFFER**](log__applier_8c.md#typedef-la_cache_buffer), logpage) + ([**io\_pagesize**](broker__monitor_8c.md#function-timeout)))

Public Types Documentation

typedef LA_ACT_LOG

typedef struct la_act_log LA_ACT_LOG;

typedef LA_APPLY

typedef struct la_apply LA_APPLY;

typedef LA_ARV_LOG

typedef struct la_arv_log LA_ARV_LOG;

typedef LA_CACHE_BUFFER

typedef struct la_cache_buffer LA_CACHE_BUFFER;

typedef LA_CACHE_BUFFER_AREA

typedef struct la_cache_buffer_area LA_CACHE_BUFFER_AREA;

typedef LA_CACHE_PB

typedef struct la_cache_pb LA_CACHE_PB;

typedef LA_COMMIT

typedef struct la_commit LA_COMMIT;

typedef LA_HA_APPLY_INFO

typedef struct la_ha_apply_info LA_HA_APPLY_INFO;

typedef LA_INFO

typedef struct la_info LA_INFO;

typedef LA_ITEM

typedef struct la_item LA_ITEM;

typedef LA_OVF_FIRST_PART

typedef struct la_ovf_first_part LA_OVF_FIRST_PART;

typedef LA_OVF_PAGE_LIST

typedef struct la_ovf_page_list LA_OVF_PAGE_LIST;

typedef LA_OVF_REST_PARTS

typedef struct la_ovf_rest_parts LA_OVF_REST_PARTS;

typedef LA_RECDES_POOL

typedef struct la_recdes_pool LA_RECDES_POOL;

typedef LA_REPL_FILTER

typedef struct la_repl_filter LA_REPL_FILTER;

Public Attributes Documentation

variable la_Info

LA_INFO la_Info;

variable la_recdes_pool

LA_RECDES_POOL la_recdes_pool;

Public Static Attributes Documentation

variable la_applier_need_shutdown

bool la_applier_need_shutdown;

variable la_applier_shutdown_by_signal

bool la_applier_shutdown_by_signal;

variable la_enable_sql_logging

bool la_enable_sql_logging;

variable la_peer_host

char la_peer_host[CUB_MAXHOSTNAMELEN+1];

variable la_slave_db_name

char la_slave_db_name[DB_MAX_IDENTIFIER_LENGTH+1];

Public Functions Documentation

function la_apply_log_file

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

function la_dump_la_act_log

void la_dump_la_act_log (
    FILE * out,
    int indent
) 

function la_dump_la_apply

void la_dump_la_apply (
    FILE * out,
    int idx,
    int indent
) 

function la_dump_la_apply_list

void la_dump_la_apply_list (
    FILE * out,
    int indent
) 

function la_dump_la_arv_log

void la_dump_la_arv_log (
    FILE * out,
    int indent
) 

function la_dump_la_info

void la_dump_la_info (
    FILE * out
) 

function la_force_shutdown

bool la_force_shutdown (
    void
) 

function la_get_applied_log_info

int la_get_applied_log_info (
    const  char * database_name,
    const  char * log_path,
    bool check_replica_info,
    bool verbose,
    LOG_LSA * applied_final_lsa
) 

function la_get_copied_log_info

int la_get_copied_log_info (
    const  char * database_name,
    const  char * log_path,
    INT64 page_num,
    bool verbose,
    LOG_LSA * copied_eof_lsa,
    LOG_LSA * copied_append_lsa
) 

function la_print_delay_info

void la_print_delay_info (
    LOG_LSA working_lsa,
    LOG_LSA target_lsa,
    float process_rate
) 

function la_print_log_arv_header

void la_print_log_arv_header (
    const  char * database_name,
    LOG_ARV_HEADER * hdr,
    bool verbose
) 

function la_print_log_header

void la_print_log_header (
    const  char * database_name,
    LOG_HEADER * hdr,
    bool verbose
) 

Public Static Functions Documentation

function check_reinit_copylog

static int check_reinit_copylog (
    void
) 

function la_add_apply_list

static LA_APPLY * la_add_apply_list (
    int tranid
) 

function la_add_node_into_la_commit_list

static int la_add_node_into_la_commit_list (
    int tranid,
    LOG_LSA * lsa,
    int type,
    time_t eot_time
) 

function la_add_repl_filter

static int la_add_repl_filter (
    const  char * classname
) 

function la_add_repl_item

static void la_add_repl_item (
    LA_APPLY * apply,
    LA_ITEM * item
) 

function la_apply_commit_list

static int la_apply_commit_list (
    LOG_LSA * lsa,
    LOG_PAGEID final_pageid
) 

function la_apply_delete_log

static int la_apply_delete_log (
    LA_ITEM * item
) 

function la_apply_insert_log

static int la_apply_insert_log (
    LA_ITEM * item
) 

function la_apply_pre

static bool la_apply_pre (
    void
) 

function la_apply_repl_log

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

function la_apply_statement_log

static int la_apply_statement_log (
    LA_ITEM * item
) 

function la_apply_update_log

static int la_apply_update_log (
    LA_ITEM * item
) 

function la_assign_recdes_from_pool

static RECDES * la_assign_recdes_from_pool (
    void
) 

function la_cache_buffer_replace

static LA_CACHE_BUFFER * la_cache_buffer_replace (
    LA_CACHE_PB * cache_pb,
    LOG_PAGEID pageid,
    int io_pagesize,
    int buffer_size
) 

function la_change_state

static int la_change_state (
    void
) 

function la_check_duplicated

static int la_check_duplicated (
    const  char * logpath,
    const  char * dbname,
    int * lockf_vdes,
    int * last_deleted_arv_num
) 

function la_check_mem_size

static int la_check_mem_size (
    void
) 

function la_check_time_commit

static int la_check_time_commit (
    struct  timeval * time,
    unsigned  int threshold
) 

function la_clear_all_repl_and_commit_list

static void la_clear_all_repl_and_commit_list (
    void
) 

function la_clear_applied_info

static void la_clear_applied_info (
    LA_APPLY * apply
) 

function la_clear_recdes_pool

static void la_clear_recdes_pool (
    void
) 

function la_commit_transaction

static int la_commit_transaction (
    void
) 

function la_count_repl_lists

static void la_count_repl_lists (
    const  LA_INFO * info,
    int * active_repl_count,
    int * long_repl_count,
    int * active_repl_item_count
) 

function la_create_repl_filter

static int la_create_repl_filter (
    void
) 

function la_decache_page_buffers

static void la_decache_page_buffers (
    LOG_PAGEID from,
    LOG_PAGEID to
) 

function la_delay_replica

static int la_delay_replica (
    time_t eot_time
) 

function la_delete_ha_apply_info

static int la_delete_ha_apply_info (
    void
) 

function la_destroy_repl_filter

static void la_destroy_repl_filter (
    void
) 

function la_disk_to_obj

static int la_disk_to_obj (
    MOBJ classobj,
    RECDES * record,
    DB_OTMPL * def,
    DB_VALUE * key
) 

function la_does_page_exist

static int la_does_page_exist (
    LOG_PAGEID pageid
) 

function la_dump_repl_filter

static void la_dump_repl_filter (
    FILE * out,
    const  LA_REPL_FILTER * filter,
    int indent
) 

function la_expand_cache_log_buffer

static int la_expand_cache_log_buffer (
    LA_CACHE_PB * cache_pb,
    int slb_cnt,
    int slb_size
) 

function la_fetch_log_hdr

static int la_fetch_log_hdr (
    LA_ACT_LOG * act_log
) 

function la_find_apply_list

static LA_APPLY * la_find_apply_list (
    int tranid
) 

function la_find_archive_num

static int la_find_archive_num (
    int * arv_log_num,
    LOG_PAGEID pageid
) 

function la_find_last_deleted_arv_num

static int la_find_last_deleted_arv_num (
    void
) 

function la_find_log_pagesize

static int la_find_log_pagesize (
    LA_ACT_LOG * act_log,
    const  char * logpath,
    const  char * dbname,
    bool check_charset
) 

function la_find_required_lsa

static int la_find_required_lsa (
    LOG_LSA * required_lsa
) 

function la_flush_repl_items

static int la_flush_repl_items (
    bool immediate
) 

function la_free_all_repl_items

static void la_free_all_repl_items (
    LA_APPLY * apply
) 

function la_free_all_repl_items_except_head

static void la_free_all_repl_items_except_head (
    LA_APPLY * apply
) 

function la_free_and_add_next_repl_item

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

function la_free_repl_item

static void la_free_repl_item (
    LA_APPLY * apply,
    LA_ITEM * item
) 

function la_free_repl_items_by_tranid

static void la_free_repl_items_by_tranid (
    int tranid
) 

function la_get_adaptive_time_commit_interval

static void la_get_adaptive_time_commit_interval (
    int * time_commit_interval,
    int * delay_hist
) 

function la_get_avg

static float la_get_avg (
    int * array,
    int size
) 

function la_get_current

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
) 

function la_get_ha_apply_info

static int la_get_ha_apply_info (
    const  char * log_path,
    const  char * prefix_name,
    LA_HA_APPLY_INFO * ha_apply_info
) 

function la_get_ha_server_state

static LOG_REC_HA_SERVER_STATE * la_get_ha_server_state (
    LOG_PAGE * pgptr,
    LOG_LSA * lsa
) 

function la_get_hostname_from_log_path

static char * la_get_hostname_from_log_path (
    char * log_path
) 

function la_get_item_pk_value

static DB_VALUE * la_get_item_pk_value (
    LA_ITEM * item
) 

function la_get_last_ha_applied_info

static int la_get_last_ha_applied_info (
    void
) 

function la_get_log_data

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
) 

function la_get_mem_size

static unsigned  long la_get_mem_size (
    void
) 

function la_get_next_repl_item

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

function la_get_next_repl_item_from_list

static LA_ITEM * la_get_next_repl_item_from_list (
    LA_ITEM * item
) 

function la_get_next_repl_item_from_log

static LA_ITEM * la_get_next_repl_item_from_log (
    LA_ITEM * item,
    LOG_LSA * last_lsa
) 

function la_get_next_update_log

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
) 

function la_get_overflow_recdes

static int la_get_overflow_recdes (
    LOG_RECORD_HEADER * lrec,
    void * logs,
    RECDES * recdes,
    unsigned  int rcvindex
) 

function la_get_page

static LOG_PAGE * la_get_page (
    LOG_PAGEID pageid
) 

function la_get_page_buffer

static LA_CACHE_BUFFER * la_get_page_buffer (
    LOG_PAGEID pageid
) 

function la_get_range_of_archive

static int la_get_range_of_archive (
    int arv_log_num,
    LOG_PAGEID * fpageid,
    DKNPAGES * npages
) 

function la_get_recdes

static int la_get_recdes (
    LOG_LSA * lsa,
    LOG_PAGE * pgptr,
    RECDES * recdes,
    unsigned  int * rcvindex,
    char * rec_type,
    bool is_mvcc_class
) 

function la_get_relocation_recdes

static int la_get_relocation_recdes (
    LOG_RECORD_HEADER * lrec,
    LOG_PAGE * pgptr,
    unsigned  int match_rcvindex,
    void ** logs,
    char ** rec_type,
    RECDES * recdes
) 

function la_get_undoredo_diff

static int la_get_undoredo_diff (
    LOG_PAGE ** pgptr,
    LOG_PAGEID * pageid,
    PGLENGTH * offset,
    bool * is_undo_zip,
    char ** undo_data,
    int * undo_length
) 

function la_get_zipped_data

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
) 

function la_ignore_on_error

static bool la_ignore_on_error (
    int errid
) 

function la_init

static void la_init (
    const  char * log_path,
    const  int max_mem_size
) 

function la_init_cache_log_buffer

static int la_init_cache_log_buffer (
    LA_CACHE_PB * cache_pb,
    int slb_cnt,
    int slb_size
) 

function la_init_cache_pb

static LA_CACHE_PB * la_init_cache_pb (
    void
) 

function la_init_delay_history

static inline void la_init_delay_history (
    int * delay_history
) 

function la_init_ha_apply_info

static void la_init_ha_apply_info (
    LA_HA_APPLY_INFO * ha_apply_info
) 

function la_init_recdes_pool

static int la_init_recdes_pool (
    int page_size,
    int num_recdes
) 

function la_init_repl_lists

static int la_init_repl_lists (
    bool need_realloc
) 

function la_insert_ha_apply_info

static int la_insert_ha_apply_info (
    DB_DATETIME * creation_time
) 

function la_invalidate_page_buffer

static void la_invalidate_page_buffer (
    LA_CACHE_BUFFER * cache_buffer
) 

function la_is_mvcc_class

static bool la_is_mvcc_class (
    const  OID * class_oid
) 

function la_is_repl_lists_empty

static bool la_is_repl_lists_empty () 

function la_lock_dbname

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

function la_log_apply_error

static void la_log_apply_error (
    const  char * op_name,
    int err_id,
    LA_ITEM * item,
    int error
) 

function la_log_commit

static int la_log_commit (
    bool update_commit_time
) 

function la_log_copy_fromlog

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

function la_log_fetch

static int la_log_fetch (
    LOG_PAGEID pageid,
    LA_CACHE_BUFFER * cache_buffer
) 

function la_log_fetch_from_archive

static int la_log_fetch_from_archive (
    LOG_PAGEID pageid,
    char * data
) 

function la_log_io_open

static int la_log_io_open (
    const  char * vlabel,
    int flags,
    int mode
) 

function la_log_io_read

static int la_log_io_read (
    char * vname,
    int vdes,
    void * io_pgptr,
    LOG_PHY_PAGEID pageid,
    int pagesize
) 

function la_log_io_read_with_max_retries

static int la_log_io_read_with_max_retries (
    char * vname,
    int vdes,
    void * io_pgptr,
    LOG_PHY_PAGEID pageid,
    int pagesize,
    int retries
) 

function la_log_phypageid

static LOG_PHY_PAGEID la_log_phypageid (
    LOG_PAGEID logical_pageid
) 

function la_log_record_process

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

function la_make_repl_item

static LA_ITEM * la_make_repl_item (
    LOG_PAGE * log_pgptr,
    int log_type,
    int tranid,
    LOG_LSA * lsa
) 

function la_make_room_for_mvcc_delid_and_prev_ver

static void la_make_room_for_mvcc_delid_and_prev_ver (
    RECDES * recdes
) 

function la_make_room_for_mvcc_insid

static void la_make_room_for_mvcc_insid (
    RECDES * recdes
) 

function la_need_filter_out

static bool la_need_filter_out (
    LA_ITEM * item
) 

function la_new_repl_item

static LA_ITEM * la_new_repl_item (
    LOG_LSA * lsa,
    LOG_LSA * target_lsa
) 

function la_print_repl_filter_info

static void la_print_repl_filter_info (
    void
) 

function la_realloc_recdes_data

static int la_realloc_recdes_data (
    RECDES * recdes,
    int data_size
) 

function la_release_all_page_buffers

static void la_release_all_page_buffers (
    LOG_PAGEID except_pageid
) 

function la_release_page_buffer

static void la_release_page_buffer (
    LOG_PAGEID pageid
) 

function la_remove_archive_logs

static int la_remove_archive_logs (
    const  char * db_name,
    int last_deleted_arv_num,
    int nxarv_num,
    int max_arv_count_to_delete
) 

function la_repl_add_object

static int la_repl_add_object (
    MOP classop,
    LA_ITEM * item,
    RECDES * recdes
) 

function la_repl_filter_type_string

static const  char * la_repl_filter_type_string (
    REPL_FILTER_TYPE type
) 

function la_restart_on_bulk_flush_error

static bool la_restart_on_bulk_flush_error (
    int errid
) 

function la_retrieve_eot_time

static time_t la_retrieve_eot_time (
    LOG_PAGE * pgptr,
    LOG_LSA * lsa
) 

function la_retry_on_error

static bool la_retry_on_error (
    int errid
) 

function la_set_error_sql_log

static void la_set_error_sql_log (
    const  char * class_name,
    DB_VALUE * key_val
) 

function la_set_peer_host

static inline void la_set_peer_host (
    char * dest,
    const  char * src
) 

function la_set_repl_log

static int la_set_repl_log (
    LOG_PAGE * log_pgptr,
    int log_type,
    int tranid,
    LOG_LSA * lsa
) 

function la_set_slave_db_name

static inline void la_set_slave_db_name (
    char * dest,
    const  char * src
) 

function la_shutdown

static void la_shutdown (
    void
) 

function la_shutdown_by_signal

static void la_shutdown_by_signal (
    int ignore
) 

static void la_unlink_repl_item (
    LA_APPLY * apply,
    LA_ITEM * item
) 

function la_unlock_dbname

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

function la_update_ha_apply_info_log_record_time

static int la_update_ha_apply_info_log_record_time (
    time_t new_time
) 

function la_update_ha_apply_info_start_time

static int la_update_ha_apply_info_start_time (
    void
) 

function la_update_ha_last_applied_info

static int la_update_ha_last_applied_info (
    void
) 

function la_update_last_deleted_arv_num

static int la_update_last_deleted_arv_num (
    int lockf_vdes,
    int last_deleted_arv_num
) 

function la_update_query_execute

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

function la_update_query_execute_with_values

static int la_update_query_execute_with_values (
    const  char * sql,
    int arg_count,
    DB_VALUE * vals,
    bool au_disable
) 

function la_write_delete_sql_log

static int la_write_delete_sql_log (
    LA_ITEM * item,
    DB_OBJECT * class_obj
) 

function la_write_insert_sql_log

static int la_write_insert_sql_log (
    LA_ITEM * item,
    DB_OBJECT * class_obj,
    RECDES * recdes
) 

function la_write_update_sql_log

static int la_write_update_sql_log (
    LA_ITEM * item,
    DB_OBJECT * class_obj,
    RECDES * recdes
) 

function log_pageid_hash

static unsigned  int log_pageid_hash (
    const  void * key,
    unsigned  int htsize
) 

Macro Definition Documentation

define LA_DEFAULT_CACHE_BUFFER_SIZE

#define LA_DEFAULT_CACHE_BUFFER_SIZE `100`

define LA_DEFAULT_LOG_PAGE_SIZE

#define LA_DEFAULT_LOG_PAGE_SIZE `4096`

define LA_GET_PAGE_RETRY_COUNT

#define LA_GET_PAGE_RETRY_COUNT `10`

define LA_IN_VALUE_COUNT

#define LA_IN_VALUE_COUNT `2`

define LA_IN_VALUE_COUNT

#define LA_IN_VALUE_COUNT `2`

define LA_IN_VALUE_COUNT

#define LA_IN_VALUE_COUNT `2`

define LA_IN_VALUE_COUNT

#define LA_IN_VALUE_COUNT `2`

define LA_IN_VALUE_COUNT

#define LA_IN_VALUE_COUNT `2`

define LA_IN_VALUE_COUNT

#define LA_IN_VALUE_COUNT `2`

define LA_IS_FLUSH_ERROR

#define LA_IS_FLUSH_ERROR (
    err
) `(( err ) == ER_LC_PARTIALLY_FAILED_TO_FLUSH || ( err ) == ER_LC_FAILED_TO_FLUSH_REPL_ITEMS )`

define LA_LOCK_SUFFIX

#define LA_LOCK_SUFFIX `"_lgla__lock"`

define LA_LOGAREA_SIZE

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

define LA_LOG_IS_IN_ARCHIVE

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

define LA_LOG_READ_ADD_ALIGN

#define LA_LOG_READ_ADD_ALIGN (
    result,
    add,
    offset,
    pageid,
    log_pgptr
) `/* multi line expression */`

define LA_LOG_READ_ADVANCE_WHEN_DOESNT_FIT

#define LA_LOG_READ_ADVANCE_WHEN_DOESNT_FIT (
    result,
    length,
    offset,
    pageid,
    pgptr
) `/* multi line expression */`

define LA_LOG_READ_ALIGN

#define LA_LOG_READ_ALIGN (
    result,
    offset,
    pageid,
    log_pgptr
) `/* multi line expression */`

define LA_MAX_REPL_ITEMS

#define LA_MAX_REPL_ITEMS `1000`

define LA_MAX_REPL_ITEM_WITHOUT_RELEASE_PB

#define LA_MAX_REPL_ITEM_WITHOUT_RELEASE_PB `50`

define LA_MAX_TOLERABLE_DELAY

#define LA_MAX_TOLERABLE_DELAY `2`

define LA_MAX_UNFLUSHED_REPL_ITEMS

#define LA_MAX_UNFLUSHED_REPL_ITEMS `200`

define LA_MOVE_INSIDE_RECORD

#define LA_MOVE_INSIDE_RECORD (
    rec,
    dest_offset,
    src_offset
) `/* multi line expression */`

define LA_NUM_DELAY_HISTORY

#define LA_NUM_DELAY_HISTORY `10`

define LA_NUM_REPL_FILTER

#define LA_NUM_REPL_FILTER `50`

define LA_OUT_VALUE_COUNT

#define LA_OUT_VALUE_COUNT `23`

define LA_PAGE_DOESNOT_EXIST

#define LA_PAGE_DOESNOT_EXIST `0`

define LA_PAGE_EXST_IN_ACTIVE_LOG

#define LA_PAGE_EXST_IN_ACTIVE_LOG `1`

define LA_PAGE_EXST_IN_ARCHIVE_LOG

#define LA_PAGE_EXST_IN_ARCHIVE_LOG `2`

define LA_QUERY_BUF_SIZE

#define LA_QUERY_BUF_SIZE `2048`

define LA_REINIT_COMMIT_INTERVAL

#define LA_REINIT_COMMIT_INTERVAL `10`

define LA_REPL_LIST_COUNT

#define LA_REPL_LIST_COUNT `50`

define LA_SLEEP

#define LA_SLEEP (
    sec,
    usec
) `/* multi line expression */`

define LA_STATUS_BUSY

#define LA_STATUS_BUSY `1`

define LA_STATUS_IDLE

#define LA_STATUS_IDLE `0`

define LA_WS_CULL_MOPS_INTERVAL

#define LA_WS_CULL_MOPS_INTERVAL `(180)`

define LA_WS_CULL_MOPS_INTERVAL_MIN

#define LA_WS_CULL_MOPS_INTERVAL_MIN `(2)`

define LA_WS_CULL_MOPS_PER_APPLY

#define LA_WS_CULL_MOPS_PER_APPLY `(100000)`

define LA_WS_CULL_MOPS_PER_APPLY_MIN

#define LA_WS_CULL_MOPS_PER_APPLY_MIN `(100)`

define SIZEOF_LA_CACHE_LOG_BUFFER

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


The documentation for this class was generated from the following file cubrid/src/transaction/log_applier.c