File log_writer.c
FileList > cubrid > src > transaction > log_writer.c
Go to the source code of this file
#include "config.h"
#include <assert.h>
#include <errno.h>
#include <dirent.h>
#include <signal.h>
#include <time.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.hpp"
#include "log_applier.h"
#include "log_storage.hpp"
#include "log_volids.hpp"
#include "crypt_opfunc.h"
#include "log_append.hpp"
#include "log_manager.h"
#include "server_support.h"
#include "network_interface_sr.h"
#include "heartbeat.h"
#include "string_buffer.hpp"
#include "memory_wrapper.hpp"
Classes
Public Types
Public Attributes
Public Static Attributes
Public Functions
| Type |
Name |
| int |
logwr_copy_log_file (const char * db_name, const char * log_path, int mode, INT64 start_page_id)
|
| int |
logwr_copy_log_header_check (const char * db_name, bool verbose, LOG_LSA * master_eof_lsa)
|
| void |
logwr_dump_json_pointer_value (FILE * out, const void * ptr)
|
| void |
logwr_dump_json_string_value (FILE * out, const char * str)
|
| void |
logwr_dump_log_arv_header (FILE * out, const LOG_ARV_HEADER * arv_hdr, int indent)
|
| void |
logwr_dump_log_header (FILE * out, const LOG_HEADER * hdr, int indent)
|
| void |
logwr_dump_log_lsa (FILE * out, const LOG_LSA * lsa, int indent)
|
| void |
logwr_dump_log_page_hdr (FILE * out, const LOG_HDRPAGE * p, int indent)
|
| void |
logwr_dump_logwr_gl (FILE * out)
|
| void |
logwr_dump_logwr_gl_topfields (FILE * out, int indent)
|
| void |
logwr_flush_header_page (void)
|
| bool |
logwr_force_shutdown (void)
|
| LOG_PAGEID |
logwr_get_min_copied_fpageid (void)
|
| const char * |
logwr_log_ha_filestat_to_string (enum LOG_HA_FILESTAT val)
|
| int |
logwr_set_hdr_and_flush_info (void)
|
| LOG_PHY_PAGEID |
logwr_to_physical_pageid (LOG_PAGEID logical_pageid)
|
| int |
logwr_write_log_pages (void)
|
| int |
xlogwr_get_log_pages (THREAD_ENTRY * thread_p, LOG_PAGEID first_pageid, LOGWR_MODE mode)
|
Public Static Functions
| Type |
Name |
| log_header |
init_cs_logwr_header ()
|
| int |
logwr_archive_active_log (void)
|
| int |
logwr_check_page_checksum (THREAD_ENTRY * thread_p, LOG_PAGE * log_pgptr)
|
| int |
logwr_copy_necessary_log (LOG_PAGEID to_pageid)
|
| void |
logwr_cs_exit (THREAD_ENTRY * thread_p, bool * check_cs_own)
|
| void |
logwr_dump_json_string_field (FILE * out, int indent, const char * name, const char * value, bool has_comma)
|
| void |
logwr_dump_logwr_action (FILE * out, LOGWR_ACTION action)
|
| void |
logwr_dump_logwr_action_item (FILE * out, const char * action_string, bool * need_separator)
|
| int |
logwr_fetch_header_page (LOG_PAGE * log_pgptr, int vol_fd, HEADER_FETCH_MODE mode=NORMAL_FETCH_MODE)
|
| void |
logwr_finalize (void)
|
| int |
logwr_flush_all_append_pages (void)
|
| int |
logwr_flush_bgarv_header_page (void)
|
| int |
logwr_initialize (const char * db_name, const char * log_path, int mode, LOG_PAGEID start_pageid)
|
| bool |
logwr_is_delayed (THREAD_ENTRY * thread_p, LOGWR_ENTRY * entry)
|
| int |
logwr_pack_log_pages (THREAD_ENTRY * thread_p, char * logpg_area, int * logpg_used_size, int * status, LOGWR_ENTRY * entry, bool copy_from_file)
|
| int |
logwr_read_bgarv_log_header (void)
|
| int |
logwr_read_log_header (void)
|
| int |
logwr_register_writer_entry (LOGWR_ENTRY ** wr_entry_p, THREAD_ENTRY * thread_p, LOG_PAGEID fpageid, int mode, bool copy_from_first_phy_page)
|
| void |
logwr_reinit_copylog (void)
|
| void |
logwr_set_eof_lsa (THREAD_ENTRY * thread_p, LOGWR_ENTRY * entry)
|
| void |
logwr_shutdown_by_signal (int)
|
| bool |
logwr_unregister_writer_entry (LOGWR_ENTRY * wr_entry, int status)
|
| void |
logwr_update_last_sent_eof_lsa (LOGWR_ENTRY * entry)
|
| void |
logwr_write_end (THREAD_ENTRY * thread_p, LOGWR_INFO * writer_info, LOGWR_ENTRY * entry, int status)
|
| LOG_PAGE ** |
logwr_writev_append_pages (LOG_PAGE ** to_flush, DKNPAGES npages)
|
Macros
| Type |
Name |
| define |
LOGWR_COPY_LOG_BUFFER_NPAGES [**LOGPB\_BUFFER\_NPAGES\_LOWER**](log__storage_8hpp.md#variable-logpb_buffer_npages_lower)
|
| define |
LOGWR_THREAD_SUSPEND_TIMEOUT 10
|
| define |
logwr_er_log (...) [**if**](dynamic__load_8c.md#function-if) ([**prm\_get\_bool\_value**](system__parameter_8h.md#function-prm_get_bool_value) (PRM\_ID\_DEBUG\_LOGWR)) [**\_er\_log\_debug**](error__manager_8c.md#function-_er_log_debug) ([**ARG\_FILE\_LINE**](error__manager_8h.md#define-arg_file_line), [**\_\_VA\_ARGS\_\_**](broker__monitor_8c.md#function-timeout))
|
Public Types Documentation
enum HEADER_FETCH_MODE {
NORMAL_FETCH_MODE = 0,
CHECK_FORMATTED_PAGE
};
typedef struct log_bgarv_header LOG_BGARV_HEADER;
Public Attributes Documentation
variable logwr_Gl
Public Static Attributes Documentation
variable logwr_need_shutdown
bool logwr_need_shutdown;
variable prev_ha_server_state
int prev_ha_server_state;
Public Functions Documentation
function logwr_copy_log_file
int logwr_copy_log_file (
const char * db_name,
const char * log_path,
int mode,
INT64 start_page_id
)
int logwr_copy_log_header_check (
const char * db_name,
bool verbose,
LOG_LSA * master_eof_lsa
)
function logwr_dump_json_pointer_value
void logwr_dump_json_pointer_value (
FILE * out,
const void * ptr
)
function logwr_dump_json_string_value
void logwr_dump_json_string_value (
FILE * out,
const char * str
)
void logwr_dump_log_arv_header (
FILE * out,
const LOG_ARV_HEADER * arv_hdr,
int indent
)
void logwr_dump_log_header (
FILE * out,
const LOG_HEADER * hdr,
int indent
)
function logwr_dump_log_lsa
void logwr_dump_log_lsa (
FILE * out,
const LOG_LSA * lsa,
int indent
)
function logwr_dump_log_page_hdr
void logwr_dump_log_page_hdr (
FILE * out,
const LOG_HDRPAGE * p,
int indent
)
function logwr_dump_logwr_gl
void logwr_dump_logwr_gl (
FILE * out
)
function logwr_dump_logwr_gl_topfields
void logwr_dump_logwr_gl_topfields (
FILE * out,
int indent
)
void logwr_flush_header_page (
void
)
function logwr_force_shutdown
bool logwr_force_shutdown (
void
)
function logwr_get_min_copied_fpageid
LOG_PAGEID logwr_get_min_copied_fpageid (
void
)
function logwr_log_ha_filestat_to_string
const char * logwr_log_ha_filestat_to_string (
enum LOG_HA_FILESTAT val
)
function logwr_set_hdr_and_flush_info
int logwr_set_hdr_and_flush_info (
void
)
function logwr_to_physical_pageid
LOG_PHY_PAGEID logwr_to_physical_pageid (
LOG_PAGEID logical_pageid
)
function logwr_write_log_pages
int logwr_write_log_pages (
void
)
function xlogwr_get_log_pages
int xlogwr_get_log_pages (
THREAD_ENTRY * thread_p,
LOG_PAGEID first_pageid,
LOGWR_MODE mode
)
Public Static Functions Documentation
static log_header init_cs_logwr_header ()
function logwr_archive_active_log
static int logwr_archive_active_log (
void
)
function logwr_check_page_checksum
static int logwr_check_page_checksum (
THREAD_ENTRY * thread_p,
LOG_PAGE * log_pgptr
)
function logwr_copy_necessary_log
static int logwr_copy_necessary_log (
LOG_PAGEID to_pageid
)
function logwr_cs_exit
static void logwr_cs_exit (
THREAD_ENTRY * thread_p,
bool * check_cs_own
)
function logwr_dump_json_string_field
static void logwr_dump_json_string_field (
FILE * out,
int indent,
const char * name,
const char * value,
bool has_comma
)
function logwr_dump_logwr_action
static void logwr_dump_logwr_action (
FILE * out,
LOGWR_ACTION action
)
function logwr_dump_logwr_action_item
static void logwr_dump_logwr_action_item (
FILE * out,
const char * action_string,
bool * need_separator
)
static int logwr_fetch_header_page (
LOG_PAGE * log_pgptr,
int vol_fd,
HEADER_FETCH_MODE mode=NORMAL_FETCH_MODE
)
function logwr_finalize
static void logwr_finalize (
void
)
function logwr_flush_all_append_pages
static int logwr_flush_all_append_pages (
void
)
static int logwr_flush_bgarv_header_page (
void
)
function logwr_initialize
static int logwr_initialize (
const char * db_name,
const char * log_path,
int mode,
LOG_PAGEID start_pageid
)
function logwr_is_delayed
static bool logwr_is_delayed (
THREAD_ENTRY * thread_p,
LOGWR_ENTRY * entry
)
function logwr_pack_log_pages
static int logwr_pack_log_pages (
THREAD_ENTRY * thread_p,
char * logpg_area,
int * logpg_used_size,
int * status,
LOGWR_ENTRY * entry,
bool copy_from_file
)
static int logwr_read_bgarv_log_header (
void
)
static int logwr_read_log_header (
void
)
function logwr_register_writer_entry
static int logwr_register_writer_entry (
LOGWR_ENTRY ** wr_entry_p,
THREAD_ENTRY * thread_p,
LOG_PAGEID fpageid,
int mode,
bool copy_from_first_phy_page
)
function logwr_reinit_copylog
static void logwr_reinit_copylog (
void
)
function logwr_set_eof_lsa
static void logwr_set_eof_lsa (
THREAD_ENTRY * thread_p,
LOGWR_ENTRY * entry
)
function logwr_shutdown_by_signal
static void logwr_shutdown_by_signal (
int
)
function logwr_unregister_writer_entry
static bool logwr_unregister_writer_entry (
LOGWR_ENTRY * wr_entry,
int status
)
function logwr_update_last_sent_eof_lsa
static void logwr_update_last_sent_eof_lsa (
LOGWR_ENTRY * entry
)
function logwr_write_end
static void logwr_write_end (
THREAD_ENTRY * thread_p,
LOGWR_INFO * writer_info,
LOGWR_ENTRY * entry,
int status
)
function logwr_writev_append_pages
static LOG_PAGE ** logwr_writev_append_pages (
LOG_PAGE ** to_flush,
DKNPAGES npages
)
Macro Definition Documentation
define LOGWR_COPY_LOG_BUFFER_NPAGES
#define LOGWR_COPY_LOG_BUFFER_NPAGES `LOGPB_BUFFER_NPAGES_LOWER`
define LOGWR_THREAD_SUSPEND_TIMEOUT
#define LOGWR_THREAD_SUSPEND_TIMEOUT `10`
define logwr_er_log
#define logwr_er_log (
...
) `if ( prm_get_bool_value ( PRM_ID_DEBUG_LOGWR )) _er_log_debug ( ARG_FILE_LINE , __VA_ARGS__ )`
The documentation for this class was generated from the following file cubrid/src/transaction/log_writer.c