CUBRID Engine  latest
log_writer.c File Reference
#include "config.h"
#include <assert.h>
#include <errno.h>
#include <dirent.h>
#include <signal.h>
#include "log_writer.h"
#include "error_manager.h"
#include "message_catalog.h"
#include "msgcat_set_log.hpp"
#include "object_representation.h"
#include "system_parameter.h"
#include "connection_support.h"
#include "log_applier.h"
#include "log_storage.hpp"
#include "log_volids.hpp"
#include "crypt_opfunc.h"
#include "network_interface_cl.h"
#include "heartbeat.h"
#include "string_buffer.hpp"
Include dependency graph for log_writer.c:

Go to the source code of this file.

Classes

struct  log_bgarv_header
 

Macros

#define LOGWR_THREAD_SUSPEND_TIMEOUT   10
 
#define LOGWR_COPY_LOG_BUFFER_NPAGES   LOGPB_BUFFER_NPAGES_LOWER
 
#define logwr_er_log(...)   if (prm_get_bool_value (PRM_ID_DEBUG_LOGWR)) _er_log_debug (ARG_FILE_LINE, __VA_ARGS__)
 

Typedefs

typedef struct log_bgarv_header LOG_BGARV_HEADER
 

Enumerations

enum  HEADER_FETCH_MODE { NORMAL_FETCH_MODE = 0, CHECK_FORMATTED_PAGE }
 

Functions

static int logwr_check_page_checksum (THREAD_ENTRY *thread_p, LOG_PAGE *log_pgptr)
 
int logwr_copy_log_file (const char *db_name, const char *log_path, int mode, INT64 start_page_id)
 
const char * logwr_log_ha_filestat_to_string (enum LOG_HA_FILESTAT val)
 

Variables

static int prev_ha_server_state = HA_SERVER_STATE_NA
 
static bool logwr_need_shutdown = false
 

Macro Definition Documentation

#define LOGWR_COPY_LOG_BUFFER_NPAGES   LOGPB_BUFFER_NPAGES_LOWER

Definition at line 68 of file log_writer.c.

Referenced by logwr_log_ha_filestat_to_string().

#define logwr_er_log (   ...)    if (prm_get_bool_value (PRM_ID_DEBUG_LOGWR)) _er_log_debug (ARG_FILE_LINE, __VA_ARGS__)

Definition at line 92 of file log_writer.c.

Referenced by logwr_log_ha_filestat_to_string().

#define LOGWR_THREAD_SUSPEND_TIMEOUT   10

Definition at line 66 of file log_writer.c.

Referenced by logwr_log_ha_filestat_to_string().

Typedef Documentation

Definition at line 73 of file log_writer.c.

Enumeration Type Documentation

Enumerator
NORMAL_FETCH_MODE 
CHECK_FORMATTED_PAGE 

Definition at line 86 of file log_writer.c.

Function Documentation

static int logwr_check_page_checksum ( THREAD_ENTRY thread_p,
LOG_PAGE log_pgptr 
)
static
int logwr_copy_log_file ( const char *  db_name,
const char *  log_path,
int  mode,
INT64  start_page_id 
)

Definition at line 1960 of file log_writer.c.

References ER_FAILED.

Referenced by copylogdb(), and logwr_info::logwr_info().

Here is the caller graph for this function:

const char* logwr_log_ha_filestat_to_string ( enum LOG_HA_FILESTAT  val)

Definition at line 2041 of file log_writer.c.

References log_global::append, log_page::area, ARG_FILE_LINE, log_arv_header::arv_num, assert, assert_release, logwr_entry::copy_from_first_phy_page, css_ha_server_state(), db_private_alloc, db_private_free_and_init, logwr_entry::eof_lsa, log_header::eof_lsa, ER_CSS_PTHREAD_COND_TIMEDOUT, ER_CSS_PTHREAD_COND_WAIT, ER_CSS_PTHREAD_MUTEX_LOCK, ER_CSS_PTHREAD_MUTEX_UNLOCK, ER_ERROR_SEVERITY, ER_FAILED, ER_HA_GENERIC_ERROR, ER_HA_LW_FAILED_GET_LOG_PAGE, ER_INTERRUPTED, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), error(), log_hdrpage::flags, logwr_info::flush_end_cond, logwr_info::flush_end_mutex, logwr_entry::fpageid, log_arv_header::fpageid, free_and_init, log_append_info::get_nxio_lsa(), log_header::ha_file_status, log_header::ha_server_state, log_page::hdr, log_global::hdr, INF_WAIT, logwr_entry::last_sent_eof_lsa, logwr_info::last_writer_client_info, logwr_info::last_writer_elapsed_time, LOG_CS_ENTER(), LOG_CS_EXIT(), LOG_FIND_THREAD_TRAN_INDEX, log_get_clock_msec(), log_Gl, LOG_HA_FILESTAT_ARCHIVED, LOG_HA_FILESTAT_CLEAR, LOG_HA_FILESTAT_SYNCHRONIZED, LOG_HDRPAGE_FLAG_ENCRYPTED_AES, LOG_HDRPAGE_FLAG_ENCRYPTED_ARIA, LOG_HDRPAGE_FLAG_ENCRYPTED_MASK, LOG_PAGESIZE, log_global::loghdr_pgptr, log_hdrpage::logical_pageid, LOGPAGEID_MAX, logpb_copy_page_from_file(), logpb_copy_page_from_log_buffer(), logpb_fetch_from_archive(), logpb_find_oldest_available_page_id(), LOGPB_HEADER_PAGE_ID, logpb_is_page_in_archive(), logpb_set_page_checksum(), logtb_get_client_ids(), logtb_is_interrupted(), logwr_check_page_checksum(), LOGWR_COPY_FROM_FIRST_PHY_PAGE_MASK, LOGWR_COPY_LOG_BUFFER_NPAGES, logwr_er_log, LOGWR_MODE_ASYNC, LOGWR_MODE_SYNC, LOGWR_STATUS_DELAY, LOGWR_STATUS_DONE, LOGWR_STATUS_ERROR, LOGWR_STATUS_FETCH, LOGWR_STATUS_WAIT, LOGWR_THREAD_SUSPEND_TIMEOUT, LSA_COPY(), LSA_GE(), LSA_INITIALIZER, LSA_ISNULL(), LSA_SET_NULL(), logwr_entry::mode, logwr_entry::next, NO_ERROR, log_arv_header::npages, NULL, NULL_OFFSET, NULL_PAGEID, log_header::nxarv_num, log_header::nxarv_pageid, log_header::nxarv_phy_pageid, log_lsa::offset, p, log_lsa::pageid, prm_get_integer_value(), PRM_ID_HA_COPY_LOG_TIMEOUT, pthread_mutex_lock, pthread_mutex_unlock, rv, logwr_entry::start_copy_time, logwr_entry::status, TDE_ALGORITHM_AES, TDE_ALGORITHM_ARIA, TDE_ALGORITHM_NONE, THREAD_LOGWR_RESUMED, THREAD_LOGWR_SUSPENDED, logwr_entry::thread_p, THREAD_RESUME_DUE_TO_INTERRUPT, THREAD_STOP_LOGWR, thread_suspend_with_other_mutex(), logwr_entry::tmp_last_sent_eof_lsa, logwr_info::trace_last_writer, logwr_info::wr_list_mutex, log_global::writer_info, logwr_info::writer_list, xlog_get_page_request_with_reply(), and xlog_send_log_pages_to_client().

Referenced by la_print_log_header(), log_active_log_header_next_scan(), and logwr_info::logwr_info().

Here is the caller graph for this function:

Variable Documentation

bool logwr_need_shutdown = false
static

Definition at line 71 of file log_writer.c.

int prev_ha_server_state = HA_SERVER_STATE_NA
static

Definition at line 70 of file log_writer.c.