CUBRID Engine
latest
|
#include <assert.h>
#include <math.h>
#include "double_write_buffer.h"
#include "system_parameter.h"
#include "thread_daemon.hpp"
#include "thread_entry_task.hpp"
#include "thread_lockfree_hash_map.hpp"
#include "thread_manager.hpp"
#include "log_append.hpp"
#include "log_impl.h"
#include "log_volids.hpp"
#include "boot_sr.h"
#include "perf_monitor.h"
#include "porting_inline.hpp"
Go to the source code of this file.
Classes | |
struct | double_write_wait_queue_entry |
struct | double_write_wait_queue |
struct | flush_volume_info |
struct | double_write_block |
struct | dwb_slots_hash_entry |
struct | double_write_buffer |
Macros | |
#define | DWB_SLOTS_HASH_SIZE 1000 |
#define | DWB_SLOTS_FREE_LIST_SIZE 100 |
#define | DWB_MIN_SIZE (512 * 1024) |
#define | DWB_MAX_SIZE (32 * 1024 * 1024) |
#define | DWB_MIN_BLOCKS 1 |
#define | DWB_MAX_BLOCKS 32 |
#define | DWB_NUM_TOTAL_BLOCKS (dwb_Global.num_blocks) |
#define | DWB_NUM_TOTAL_PAGES (dwb_Global.num_pages) |
#define | DWB_BLOCK_NUM_PAGES (dwb_Global.num_block_pages) |
#define | DWB_LOG2_BLOCK_NUM_PAGES (dwb_Global.log2_num_block_pages) |
#define | DWB_POSITION_MASK 0x000000003fffffff |
#define | DWB_BLOCKS_STATUS_MASK 0xffffffff00000000 |
#define | DWB_MODIFY_STRUCTURE 0x0000000080000000 |
#define | DWB_CREATE 0x0000000040000000 |
#define | DWB_CREATE_OR_MODIFY_MASK (DWB_CREATE | DWB_MODIFY_STRUCTURE) |
#define | DWB_FLAG_MASK (DWB_BLOCKS_STATUS_MASK | DWB_MODIFY_STRUCTURE | DWB_CREATE) |
#define | DWB_GET_POSITION(position_with_flags) ((position_with_flags) & DWB_POSITION_MASK) |
#define | DWB_RESET_POSITION(position_with_flags) ((position_with_flags) & DWB_FLAG_MASK) |
#define | DWB_GET_BLOCK_STATUS(position_with_flags) ((position_with_flags) & DWB_BLOCKS_STATUS_MASK) |
#define | DWB_GET_BLOCK_NO_FROM_POSITION(position_with_flags) ((unsigned int) DWB_GET_POSITION (position_with_flags) >> (DWB_LOG2_BLOCK_NUM_PAGES)) |
#define | DWB_IS_BLOCK_WRITE_STARTED(position_with_flags, block_no) (assert (block_no < DWB_MAX_BLOCKS), ((position_with_flags) & (1ULL << (63 - (block_no)))) != 0) |
#define | DWB_IS_ANY_BLOCK_WRITE_STARTED(position_with_flags) (((position_with_flags) & DWB_BLOCKS_STATUS_MASK) != 0) |
#define | DWB_STARTS_BLOCK_WRITING(position_with_flags, block_no) (assert (block_no < DWB_MAX_BLOCKS), (position_with_flags) | (1ULL << (63 - (block_no)))) |
#define | DWB_ENDS_BLOCK_WRITING(position_with_flags, block_no) |
#define | DWB_STARTS_MODIFYING_STRUCTURE(position_with_flags) ((position_with_flags) | DWB_MODIFY_STRUCTURE) |
#define | DWB_ENDS_MODIFYING_STRUCTURE(position_with_flags) (assert (DWB_IS_MODIFYING_STRUCTURE (position_with_flags)), (position_with_flags) & ~DWB_MODIFY_STRUCTURE) |
#define | DWB_IS_MODIFYING_STRUCTURE(position_with_flags) (((position_with_flags) & DWB_MODIFY_STRUCTURE) != 0) |
#define | DWB_STARTS_CREATION(position_with_flags) ((position_with_flags) | DWB_CREATE) |
#define | DWB_ENDS_CREATION(position_with_flags) (assert (DWB_IS_CREATED (position_with_flags)), (position_with_flags) & ~DWB_CREATE) |
#define | DWB_IS_CREATED(position_with_flags) (((position_with_flags) & DWB_CREATE) != 0) |
#define | DWB_NOT_CREATED_OR_MODIFYING(position_with_flags) (((position_with_flags) & DWB_CREATE_OR_MODIFY_MASK) != DWB_CREATE) |
#define | DWB_GET_NEXT_POSITION_WITH_FLAGS(position_with_flags) |
#define | DWB_GET_POSITION_IN_BLOCK(position_with_flags) ((DWB_GET_POSITION (position_with_flags)) & (DWB_BLOCK_NUM_PAGES - 1)) |
#define | DWB_GET_PREV_BLOCK_NO(block_no) ((block_no) > 0 ? ((block_no) - 1) : (DWB_NUM_TOTAL_BLOCKS - 1)) |
#define | DWB_GET_PREV_BLOCK(block_no) (&(dwb_Global.blocks[DWB_GET_PREV_BLOCK_NO(block_no)])) |
#define | DWB_GET_NEXT_BLOCK_NO(block_no) ((block_no) == (DWB_NUM_TOTAL_BLOCKS - 1) ? 0 : ((block_no) + 1)) |
#define | DWB_GET_BLOCK_VERSION(block) (ATOMIC_INC_64 (&block->version, 0ULL)) |
#define | DWB_WAIT_QUEUE_INITIALIZER {NULL, NULL, NULL, 0, 0} |
#define | dwb_Log dwb_Global.logging_enabled |
#define | dwb_check_logging() (dwb_Log = prm_get_bool_value (PRM_ID_DWB_LOGGING)) |
#define | dwb_log(...) if (dwb_Log) _er_log_debug (ARG_FILE_LINE, "DWB: " __VA_ARGS__) |
#define | dwb_log_error(...) if (dwb_Log) _er_log_debug (ARG_FILE_LINE, "DWB ERROR: " __VA_ARGS__) |
#define | pthread_mutex_init(a, b) |
#define | pthread_mutex_destroy(a) |
#define | pthread_mutex_lock(a) 0 |
#define | pthread_mutex_unlock(a) |
Typedefs | |
typedef struct double_write_wait_queue_entry | DWB_WAIT_QUEUE_ENTRY |
typedef struct double_write_wait_queue | DWB_WAIT_QUEUE |
typedef struct flush_volume_info | FLUSH_VOLUME_INFO |
typedef struct double_write_block | DWB_BLOCK |
typedef struct dwb_slots_hash_entry | DWB_SLOTS_HASH_ENTRY |
using | dwb_hashmap_type = cubthread::lockfree_hashmap< VPID, dwb_slots_hash_entry > |
typedef struct double_write_buffer | DOUBLE_WRITE_BUFFER |
Enumerations | |
enum | FLUSH_VOLUME_STATUS { VOLUME_NOT_FLUSHED, VOLUME_FLUSHED_BY_DWB_FILE_SYNC_HELPER_THREAD, VOLUME_FLUSHED_BY_DWB_FLUSH_THREAD } |
Variables | |
char | dwb_Volume_name [PATH_MAX] |
static DOUBLE_WRITE_BUFFER | dwb_Global |
static LF_ENTRY_DESCRIPTOR | slots_entry_Descriptor |
#define DWB_BLOCK_NUM_PAGES (dwb_Global.num_block_pages) |
Definition at line 58 of file double_write_buffer.c.
Referenced by dwb_acquire_next_slot(), dwb_add_page(), dwb_flush_block(), dwb_flush_force(), dwb_flush_next_block(), dwb_get_next_block_for_flush(), and dwb_write_block().
#define DWB_BLOCKS_STATUS_MASK 0xffffffff00000000 |
Definition at line 68 of file double_write_buffer.c.
#define dwb_check_logging | ( | ) | (dwb_Log = prm_get_bool_value (PRM_ID_DWB_LOGGING)) |
Definition at line 310 of file double_write_buffer.c.
Referenced by dwb_load_and_recover_pages().
#define DWB_CREATE 0x0000000040000000 |
Definition at line 74 of file double_write_buffer.c.
#define DWB_CREATE_OR_MODIFY_MASK (DWB_CREATE | DWB_MODIFY_STRUCTURE) |
Definition at line 77 of file double_write_buffer.c.
#define DWB_ENDS_BLOCK_WRITING | ( | position_with_flags, | |
block_no | |||
) |
Definition at line 112 of file double_write_buffer.c.
Referenced by dwb_flush_block().
#define DWB_ENDS_CREATION | ( | position_with_flags | ) | (assert (DWB_IS_CREATED (position_with_flags)), (position_with_flags) & ~DWB_CREATE) |
Definition at line 133 of file double_write_buffer.c.
Referenced by dwb_destroy_internal().
#define DWB_ENDS_MODIFYING_STRUCTURE | ( | position_with_flags | ) | (assert (DWB_IS_MODIFYING_STRUCTURE (position_with_flags)), (position_with_flags) & ~DWB_MODIFY_STRUCTURE) |
Definition at line 121 of file double_write_buffer.c.
Referenced by dwb_ends_structure_modification().
#define DWB_FLAG_MASK (DWB_BLOCKS_STATUS_MASK | DWB_MODIFY_STRUCTURE | DWB_CREATE) |
Definition at line 80 of file double_write_buffer.c.
#define DWB_GET_BLOCK_NO_FROM_POSITION | ( | position_with_flags | ) | ((unsigned int) DWB_GET_POSITION (position_with_flags) >> (DWB_LOG2_BLOCK_NUM_PAGES)) |
Definition at line 96 of file double_write_buffer.c.
Referenced by dwb_acquire_next_slot(), and dwb_flush_force().
#define DWB_GET_BLOCK_STATUS | ( | position_with_flags | ) | ((position_with_flags) & DWB_BLOCKS_STATUS_MASK) |
Definition at line 92 of file double_write_buffer.c.
Referenced by dwb_flush_force(), and dwb_starts_structure_modification().
#define DWB_GET_BLOCK_VERSION | ( | block | ) | (ATOMIC_INC_64 (&block->version, 0ULL)) |
Definition at line 166 of file double_write_buffer.c.
#define DWB_GET_NEXT_BLOCK_NO | ( | block_no | ) | ((block_no) == (DWB_NUM_TOTAL_BLOCKS - 1) ? 0 : ((block_no) + 1)) |
Definition at line 162 of file double_write_buffer.c.
Referenced by dwb_flush_block().
#define DWB_GET_NEXT_POSITION_WITH_FLAGS | ( | position_with_flags | ) |
Definition at line 145 of file double_write_buffer.c.
Referenced by dwb_acquire_next_slot().
#define DWB_GET_POSITION | ( | position_with_flags | ) | ((position_with_flags) & DWB_POSITION_MASK) |
Definition at line 84 of file double_write_buffer.c.
#define DWB_GET_POSITION_IN_BLOCK | ( | position_with_flags | ) | ((DWB_GET_POSITION (position_with_flags)) & (DWB_BLOCK_NUM_PAGES - 1)) |
Definition at line 150 of file double_write_buffer.c.
Referenced by dwb_acquire_next_slot().
#define DWB_GET_PREV_BLOCK | ( | block_no | ) | (&(dwb_Global.blocks[DWB_GET_PREV_BLOCK_NO(block_no)])) |
Definition at line 158 of file double_write_buffer.c.
Referenced by dwb_flush_next_block().
#define DWB_GET_PREV_BLOCK_NO | ( | block_no | ) | ((block_no) > 0 ? ((block_no) - 1) : (DWB_NUM_TOTAL_BLOCKS - 1)) |
Definition at line 154 of file double_write_buffer.c.
Referenced by dwb_flush_next_block().
#define DWB_IS_ANY_BLOCK_WRITE_STARTED | ( | position_with_flags | ) | (((position_with_flags) & DWB_BLOCKS_STATUS_MASK) != 0) |
Definition at line 104 of file double_write_buffer.c.
Referenced by dwb_acquire_next_slot().
#define DWB_IS_BLOCK_WRITE_STARTED | ( | position_with_flags, | |
block_no | |||
) | (assert (block_no < DWB_MAX_BLOCKS), ((position_with_flags) & (1ULL << (63 - (block_no)))) != 0) |
Definition at line 100 of file double_write_buffer.c.
Referenced by dwb_acquire_next_slot(), dwb_flush_force(), dwb_starts_structure_modification(), and dwb_wait_for_block_completion().
#define DWB_IS_CREATED | ( | position_with_flags | ) | (((position_with_flags) & DWB_CREATE) != 0) |
Definition at line 137 of file double_write_buffer.c.
Referenced by dwb_acquire_next_slot(), dwb_create(), dwb_destroy(), dwb_file_sync_helper(), dwb_flush_force(), dwb_flush_next_block(), dwb_is_created(), and dwb_recreate().
#define DWB_IS_MODIFYING_STRUCTURE | ( | position_with_flags | ) | (((position_with_flags) & DWB_MODIFY_STRUCTURE) != 0) |
Definition at line 125 of file double_write_buffer.c.
Referenced by dwb_acquire_next_slot(), dwb_file_sync_helper(), dwb_flush_block(), dwb_flush_force(), dwb_flush_next_block(), dwb_starts_structure_modification(), and dwb_wait_for_strucure_modification().
#define dwb_Log dwb_Global.logging_enabled |
Definition at line 308 of file double_write_buffer.c.
#define dwb_log | ( | ... | ) | if (dwb_Log) _er_log_debug (ARG_FILE_LINE, "DWB: " __VA_ARGS__) |
Definition at line 311 of file double_write_buffer.c.
Referenced by dwb_acquire_next_slot(), dwb_add_page(), dwb_check_data_page_is_sane(), dwb_file_sync_helper(), dwb_flush_block(), dwb_flush_force(), dwb_flush_next_block(), dwb_load_and_recover_pages(), dwb_slots_hash_insert(), dwb_starts_structure_modification(), and dwb_write_block().
#define DWB_LOG2_BLOCK_NUM_PAGES (dwb_Global.log2_num_block_pages) |
Definition at line 61 of file double_write_buffer.c.
#define dwb_log_error | ( | ... | ) | if (dwb_Log) _er_log_debug (ARG_FILE_LINE, "DWB ERROR: " __VA_ARGS__) |
Definition at line 312 of file double_write_buffer.c.
Referenced by dwb_acquire_next_slot(), dwb_add_page(), dwb_check_data_page_is_sane(), dwb_create(), dwb_flush_force(), dwb_flush_next_block(), dwb_load_and_recover_pages(), dwb_slots_hash_delete(), dwb_starts_structure_modification(), and dwb_write_block().
#define DWB_MAX_BLOCKS 32 |
Definition at line 49 of file double_write_buffer.c.
Referenced by dwb_adjust_write_buffer_values(), dwb_create_blocks(), and dwb_create_internal().
#define DWB_MAX_SIZE (32 * 1024 * 1024) |
Definition at line 47 of file double_write_buffer.c.
Referenced by dwb_adjust_write_buffer_values().
#define DWB_MIN_BLOCKS 1 |
Definition at line 48 of file double_write_buffer.c.
Referenced by dwb_adjust_write_buffer_values().
#define DWB_MIN_SIZE (512 * 1024) |
Definition at line 46 of file double_write_buffer.c.
Referenced by dwb_adjust_write_buffer_values().
#define DWB_MODIFY_STRUCTURE 0x0000000080000000 |
Definition at line 71 of file double_write_buffer.c.
#define DWB_NOT_CREATED_OR_MODIFYING | ( | position_with_flags | ) | (((position_with_flags) & DWB_CREATE_OR_MODIFY_MASK) != DWB_CREATE) |
Definition at line 141 of file double_write_buffer.c.
Referenced by dwb_acquire_next_slot(), and dwb_flush_force().
#define DWB_NUM_TOTAL_BLOCKS (dwb_Global.num_blocks) |
Definition at line 52 of file double_write_buffer.c.
Referenced by dwb_acquire_next_slot(), dwb_destroy_internal(), dwb_flush_force(), dwb_flush_next_block(), dwb_get_next_block_for_flush(), dwb_starts_structure_modification(), and dwb_wait_for_block_completion().
#define DWB_NUM_TOTAL_PAGES (dwb_Global.num_pages) |
Definition at line 55 of file double_write_buffer.c.
#define DWB_POSITION_MASK 0x000000003fffffff |
Definition at line 65 of file double_write_buffer.c.
#define DWB_RESET_POSITION | ( | position_with_flags | ) | ((position_with_flags) & DWB_FLAG_MASK) |
Definition at line 88 of file double_write_buffer.c.
Referenced by dwb_create_internal(), and dwb_destroy_internal().
#define DWB_SLOTS_FREE_LIST_SIZE 100 |
Definition at line 44 of file double_write_buffer.c.
Referenced by dwb_create_internal().
#define DWB_SLOTS_HASH_SIZE 1000 |
Definition at line 43 of file double_write_buffer.c.
Referenced by dwb_create_internal().
#define DWB_STARTS_BLOCK_WRITING | ( | position_with_flags, | |
block_no | |||
) | (assert (block_no < DWB_MAX_BLOCKS), (position_with_flags) | (1ULL << (63 - (block_no)))) |
Definition at line 108 of file double_write_buffer.c.
Referenced by dwb_acquire_next_slot().
#define DWB_STARTS_CREATION | ( | position_with_flags | ) | ((position_with_flags) | DWB_CREATE) |
Definition at line 129 of file double_write_buffer.c.
Referenced by dwb_create_internal().
#define DWB_STARTS_MODIFYING_STRUCTURE | ( | position_with_flags | ) | ((position_with_flags) | DWB_MODIFY_STRUCTURE) |
Definition at line 117 of file double_write_buffer.c.
Referenced by dwb_starts_structure_modification().
Definition at line 188 of file double_write_buffer.c.
#define pthread_mutex_destroy | ( | a | ) |
Definition at line 316 of file double_write_buffer.c.
Referenced by dwb_destroy_internal(), dwb_finalize_block(), dwb_slots_hash_entry_free(), and dwb_slots_hash_entry::~dwb_slots_hash_entry().
#define pthread_mutex_init | ( | a, | |
b | |||
) |
Definition at line 315 of file double_write_buffer.c.
Referenced by dwb_create_internal(), dwb_initialize_block(), dwb_slots_hash_entry::dwb_slots_hash_entry(), and dwb_slots_hash_entry_alloc().
#define pthread_mutex_lock | ( | a | ) | 0 |
Definition at line 317 of file double_write_buffer.c.
Referenced by dwb_destroy_wait_queue(), dwb_remove_wait_queue_entry(), dwb_signal_waiting_threads(), dwb_wait_for_block_completion(), and dwb_wait_for_strucure_modification().
#define pthread_mutex_unlock | ( | a | ) |
Definition at line 318 of file double_write_buffer.c.
Referenced by dwb_destroy_wait_queue(), dwb_read_page(), dwb_remove_wait_queue_entry(), dwb_signal_waiting_threads(), dwb_slots_hash_delete(), dwb_slots_hash_insert(), dwb_wait_for_block_completion(), and dwb_wait_for_strucure_modification().
typedef struct double_write_buffer DOUBLE_WRITE_BUFFER |
Definition at line 258 of file double_write_buffer.c.
typedef struct double_write_block DWB_BLOCK |
Definition at line 208 of file double_write_buffer.c.
Definition at line 254 of file double_write_buffer.c.
typedef struct dwb_slots_hash_entry DWB_SLOTS_HASH_ENTRY |
Definition at line 228 of file double_write_buffer.c.
typedef struct double_write_wait_queue DWB_WAIT_QUEUE |
Definition at line 178 of file double_write_buffer.c.
typedef struct double_write_wait_queue_entry DWB_WAIT_QUEUE_ENTRY |
Definition at line 170 of file double_write_buffer.c.
typedef struct flush_volume_info FLUSH_VOLUME_INFO |
Definition at line 198 of file double_write_buffer.c.
enum FLUSH_VOLUME_STATUS |
Enumerator | |
---|---|
VOLUME_NOT_FLUSHED | |
VOLUME_FLUSHED_BY_DWB_FILE_SYNC_HELPER_THREAD | |
VOLUME_FLUSHED_BY_DWB_FLUSH_THREAD |
Definition at line 191 of file double_write_buffer.c.
STATIC_INLINE int dwb_acquire_next_slot | ( | THREAD_ENTRY * | thread_p, |
bool | can_wait, | ||
DWB_SLOT ** | p_dwb_slot | ||
) |
Definition at line 2443 of file double_write_buffer.c.
References ARG_FILE_LINE, assert, double_write_buffer::blocks, DWB_BLOCK_NUM_PAGES, DWB_GET_BLOCK_NO_FROM_POSITION, DWB_GET_NEXT_POSITION_WITH_FLAGS, DWB_GET_POSITION_IN_BLOCK, DWB_IS_ANY_BLOCK_WRITE_STARTED, DWB_IS_BLOCK_WRITE_STARTED, DWB_IS_CREATED, DWB_IS_MODIFYING_STRUCTURE, dwb_log, dwb_log_error, DWB_NOT_CREATED_OR_MODIFYING, DWB_NUM_TOTAL_BLOCKS, DWB_STARTS_BLOCK_WRITING, dwb_wait_for_block_completion(), dwb_wait_for_strucure_modification(), ER_CSS_PTHREAD_COND_TIMEDOUT, ER_DWB_DISABLED, ER_ERROR_SEVERITY, er_set(), NO_ERROR, NULL, double_write_buffer::position_with_flags, double_write_block::slots, STATIC_INLINE, double_write_block::version, and VPID_SET_NULL.
Referenced by dwb_set_data_on_next_slot().
int dwb_add_page | ( | THREAD_ENTRY * | thread_p, |
FILEIO_PAGE * | io_page_p, | ||
VPID * | vpid, | ||
DWB_SLOT ** | p_dwb_slot | ||
) |
Definition at line 2695 of file double_write_buffer.c.
References assert, assert_release, double_write_slot::block_no, double_write_block::block_no, double_write_buffer::blocks, double_write_block::count_wb_pages, DWB_BLOCK_NUM_PAGES, dwb_flush_block(), dwb_is_flush_block_daemon_available(), dwb_log, dwb_log_error, dwb_set_data_on_next_slot(), dwb_slots_hash_insert(), fileio_initialize_res(), double_write_slot::io_page, IO_PAGESIZE, NO_ERROR, NULL, vpid::pageid, double_write_slot::position_in_block, thread_get_thread_entry_info(), double_write_block::version, vpid::volid, double_write_slot::vpid, VPID_EQ, VPID_ISNULL, and VPID_SET_NULL.
Referenced by dwb_flush_force(), fileio_write_or_add_to_dwb(), and pgbuf_bcb_flush_with_wal().
STATIC_INLINE FLUSH_VOLUME_INFO * dwb_add_volume_to_block_flush_area | ( | THREAD_ENTRY * | thread_p, |
DWB_BLOCK * | block, | ||
int | vol_fd | ||
) |
Definition at line 1945 of file double_write_buffer.c.
References flush_volume_info::all_pages_written, assert, double_write_block::count_flush_volumes_info, double_write_block::flush_volumes_info, flush_volume_info::flushed_status, double_write_block::max_to_flush_vdes, NULL_VOLDES, flush_volume_info::num_pages, STATIC_INLINE, flush_volume_info::vdes, and VOLUME_NOT_FLUSHED.
Referenced by dwb_write_block().
STATIC_INLINE void dwb_adjust_write_buffer_values | ( | unsigned int * | p_double_write_buffer_size, |
unsigned int * | p_num_blocks | ||
) |
Definition at line 729 of file double_write_buffer.c.
References assert, DWB_MAX_BLOCKS, DWB_MAX_SIZE, DWB_MIN_BLOCKS, DWB_MIN_SIZE, IS_POWER_OF_2, and STATIC_INLINE.
Referenced by dwb_create_internal().
STATIC_INLINE DWB_WAIT_QUEUE_ENTRY * dwb_block_add_wait_queue_entry | ( | DWB_WAIT_QUEUE * | wait_queue, |
void * | data | ||
) |
Definition at line 504 of file double_write_buffer.c.
References assert, double_write_wait_queue::count, dwb_make_wait_queue_entry(), double_write_wait_queue::head, double_write_wait_queue_entry::next, NULL, STATIC_INLINE, and double_write_wait_queue::tail.
Referenced by dwb_wait_for_block_completion(), and dwb_wait_for_strucure_modification().
STATIC_INLINE int dwb_block_create_ordered_slots | ( | DWB_BLOCK * | block, |
DWB_SLOT ** | p_dwb_ordered_slots, | ||
unsigned int * | p_ordered_slots_length | ||
) |
Definition at line 1831 of file double_write_buffer.c.
References ARG_FILE_LINE, assert, double_write_block::count_wb_pages, dwb_compare_slots(), dwb_init_slot(), ER_ERROR_SEVERITY, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), NO_ERROR, NULL, double_write_block::slots, and STATIC_INLINE.
Referenced by dwb_flush_block(), and dwb_load_and_recover_pages().
STATIC_INLINE DWB_WAIT_QUEUE_ENTRY * dwb_block_disconnect_wait_queue_entry | ( | DWB_WAIT_QUEUE * | wait_queue, |
void * | data | ||
) |
Definition at line 539 of file double_write_buffer.c.
References assert, double_write_wait_queue::count, double_write_wait_queue_entry::data, double_write_wait_queue::head, double_write_wait_queue_entry::next, NULL, STATIC_INLINE, and double_write_wait_queue::tail.
Referenced by dwb_remove_wait_queue_entry().
STATIC_INLINE void dwb_block_free_wait_queue_entry | ( | DWB_WAIT_QUEUE * | wait_queue, |
DWB_WAIT_QUEUE_ENTRY * | wait_queue_entry, | ||
int(*)(void *) | func | ||
) |
Definition at line 601 of file double_write_buffer.c.
References double_write_wait_queue::free_count, double_write_wait_queue::free_list, double_write_wait_queue_entry::next, and STATIC_INLINE.
Referenced by dwb_remove_wait_queue_entry().
|
static |
Definition at line 2987 of file double_write_buffer.c.
References assert, ASSERT_ERROR_AND_SET, assert_release, double_write_block::count_wb_pages, dwb_log, dwb_log_error, ER_FAILED, fileio_get_number_of_volume_pages(), fileio_get_volume_descriptor(), fileio_initialize_res(), fileio_page_check_corruption(), fileio_read(), i, IO_MAX_PAGE_SIZE, IO_PAGESIZE, MAX_ALIGNMENT, NO_ERROR, NULL_VOLDES, NULL_VOLID, vpid::pageid, PTR_ALIGN, vpid::volid, double_write_slot::vpid, VPID_ISNULL, and VPID_SET_NULL.
Referenced by dwb_load_and_recover_pages().
Definition at line 1767 of file double_write_buffer.c.
References assert, diff, double_write_slot::lsa, log_lsa::offset, log_lsa::pageid, vpid::pageid, STATIC_INLINE, vpid::volid, and double_write_slot::vpid.
Referenced by dwb_block_create_ordered_slots().
Definition at line 1924 of file double_write_buffer.c.
References assert, and STATIC_INLINE.
int dwb_create | ( | THREAD_ENTRY * | thread_p, |
const char * | dwb_path_p, | ||
const char * | db_name_p | ||
) |
Definition at line 2821 of file double_write_buffer.c.
References dwb_create_internal(), dwb_ends_structure_modification(), DWB_IS_CREATED, dwb_log_error, dwb_starts_structure_modification(), dwb_Volume_name, fileio_make_dwb_name(), and NO_ERROR.
Referenced by boot_create_all_volumes(), and dwb_load_and_recover_pages().
STATIC_INLINE int dwb_create_blocks | ( | THREAD_ENTRY * | thread_p, |
unsigned int | num_blocks, | ||
unsigned int | num_block_pages, | ||
DWB_BLOCK ** | p_blocks | ||
) |
Definition at line 994 of file double_write_buffer.c.
References ARG_FILE_LINE, assert, dwb_initialize_block(), dwb_initialize_slot(), DWB_MAX_BLOCKS, ER_ERROR_SEVERITY, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), fileio_initialize_res(), free_and_init, i, IO_PAGESIZE, NO_ERROR, NULL, and STATIC_INLINE.
Referenced by dwb_create_internal(), and dwb_load_and_recover_pages().
STATIC_INLINE int dwb_create_internal | ( | THREAD_ENTRY * | thread_p, |
const char * | dwb_volume_name, | ||
UINT64 * | current_position_with_flags | ||
) |
Definition at line 1148 of file double_write_buffer.c.
References assert, double_write_buffer::blocks, double_write_buffer::blocks_flush_counter, boot_db_full_name(), dwb_adjust_write_buffer_values(), dwb_create_blocks(), dwb_finalize_block(), dwb_init_wait_queue(), DWB_MAX_BLOCKS, DWB_RESET_POSITION, DWB_SLOTS_FREE_LIST_SIZE, DWB_SLOTS_HASH_SIZE, dwb_slots_Ts, DWB_STARTS_CREATION, double_write_buffer::file_sync_helper_block, fileio_dismount(), fileio_format(), fileio_synchronize_all(), fileio_unformat(), free_and_init, i, cubthread::lockfree_hashmap< Key, T >::init(), IO_PAGESIZE, IS_POWER_OF_2, double_write_buffer::log2_num_block_pages, LOG_DBDWB_VOLID, double_write_buffer::mutex, double_write_buffer::next_block_to_flush, NO_ERROR, NULL, NULL_VOLDES, double_write_buffer::num_block_pages, double_write_buffer::num_blocks, double_write_buffer::num_pages, double_write_buffer::position_with_flags, prm_get_integer_value(), PRM_ID_DWB_BLOCKS, PRM_ID_DWB_SIZE, pthread_mutex_init, double_write_buffer::slots_hashmap, THREAD_TS_DWB_SLOTS, double_write_buffer::vdes, and double_write_buffer::wait_queue.
Referenced by dwb_create(), and dwb_recreate().
|
static |
Definition at line 2909 of file double_write_buffer.c.
References assert, fileio_page_check_corruption(), i, IO_MAX_PAGE_SIZE, IO_PAGESIZE, MAX_ALIGNMENT, NO_ERROR, PTR_ALIGN, VPID_EQ, and VPID_ISNULL.
Referenced by dwb_load_and_recover_pages().
int dwb_destroy | ( | THREAD_ENTRY * | thread_p | ) |
Definition at line 3299 of file double_write_buffer.c.
References dwb_destroy_internal(), dwb_ends_structure_modification(), DWB_IS_CREATED, dwb_starts_structure_modification(), and NO_ERROR.
Referenced by logpb_copy_database(), and xboot_shutdown_server().
STATIC_INLINE void dwb_destroy_internal | ( | THREAD_ENTRY * | thread_p, |
UINT64 * | current_position_with_flags | ||
) |
Definition at line 1460 of file double_write_buffer.c.
References assert, double_write_buffer::blocks, cubthread::lockfree_hashmap< Key, T >::destroy(), dwb_destroy_wait_queue(), DWB_ENDS_CREATION, dwb_finalize_block(), DWB_NUM_TOTAL_BLOCKS, DWB_RESET_POSITION, dwb_Volume_name, fileio_dismount(), fileio_unformat(), free_and_init, double_write_buffer::mutex, NULL_VOLDES, double_write_buffer::position_with_flags, pthread_mutex_destroy, double_write_buffer::slots_hashmap, STATIC_INLINE, double_write_buffer::vdes, and double_write_buffer::wait_queue.
Referenced by dwb_destroy(), and dwb_recreate().
STATIC_INLINE void dwb_destroy_wait_queue | ( | DWB_WAIT_QUEUE * | wait_queue, |
pthread_mutex_t * | mutex | ||
) |
Definition at line 689 of file double_write_buffer.c.
References assert, dwb_signal_waiting_threads(), free_and_init, double_write_wait_queue::free_count, double_write_wait_queue::free_list, double_write_wait_queue_entry::next, pthread_mutex_lock, pthread_mutex_unlock, and STATIC_INLINE.
Referenced by dwb_destroy_internal(), and dwb_finalize_block().
STATIC_INLINE void dwb_ends_structure_modification | ( | THREAD_ENTRY * | thread_p, |
UINT64 | current_position_with_flags | ||
) |
Definition at line 909 of file double_write_buffer.c.
References assert, DWB_ENDS_MODIFYING_STRUCTURE, dwb_signal_structure_modificated(), double_write_buffer::position_with_flags, and STATIC_INLINE.
Referenced by dwb_create(), dwb_destroy(), and dwb_recreate().
|
static |
Definition at line 3666 of file double_write_buffer.c.
References flush_volume_info::all_pages_written, double_write_block::all_pages_written, assert, assert_release, double_write_block::count_flush_volumes_info, DWB_IS_CREATED, DWB_IS_MODIFYING_STRUCTURE, dwb_log, double_write_buffer::file_sync_helper_block, FILEIO_SYNC_ONLY, fileio_synchronize(), double_write_block::flush_volumes_info, flush_volume_info::flushed_status, i, if(), NO_ERROR, NULL, flush_volume_info::num_pages, double_write_buffer::position_with_flags, prm_get_integer_value(), PRM_ID_PB_SYNC_ON_NFLUSH, PSTAT_DWB_FILE_SYNC_HELPER_TIME_COUNTERS, thread_sleep(), flush_volume_info::vdes, VOLUME_FLUSHED_BY_DWB_FILE_SYNC_HELPER_THREAD, VOLUME_FLUSHED_BY_DWB_FLUSH_THREAD, and VOLUME_NOT_FLUSHED.
Referenced by dwb_read_page().
|
static |
Definition at line 4066 of file double_write_buffer.c.
References cubthread::daemon::is_running(), prm_get_bool_value(), and PRM_ID_ENABLE_DWB_FLUSH_THREAD.
Referenced by dwb_starts_structure_modification().
STATIC_INLINE void dwb_finalize_block | ( | DWB_BLOCK * | block | ) |
Definition at line 1116 of file double_write_buffer.c.
References dwb_destroy_wait_queue(), double_write_block::flush_volumes_info, free_and_init, double_write_block::mutex, pthread_mutex_destroy, double_write_block::slots, STATIC_INLINE, double_write_block::wait_queue, and double_write_block::write_buffer.
Referenced by dwb_create_internal(), dwb_destroy_internal(), and dwb_load_and_recover_pages().
STATIC_INLINE int dwb_flush_block | ( | THREAD_ENTRY * | thread_p, |
DWB_BLOCK * | block, | ||
bool | file_sync_helper_can_flush, | ||
UINT64 * | current_position_with_flags | ||
) |
Definition at line 2170 of file double_write_buffer.c.
References flush_volume_info::all_pages_written, double_write_block::all_pages_written, log_global::append, assert, assert_release, double_write_block::block_no, double_write_buffer::blocks_flush_counter, double_write_block::count_flush_volumes_info, double_write_block::count_wb_pages, dwb_block_create_ordered_slots(), DWB_BLOCK_NUM_PAGES, DWB_ENDS_BLOCK_WRITING, DWB_GET_NEXT_BLOCK_NO, dwb_is_created(), dwb_is_file_sync_helper_daemon_available(), DWB_IS_MODIFYING_STRUCTURE, dwb_log, dwb_signal_block_completion(), dwb_Volume_name, dwb_write_block(), ER_FAILED, double_write_buffer::file_sync_helper_block, fileio_initialize_res(), FILEIO_SYNC_ONLY, fileio_synchronize(), FILEIO_WRITE_NO_COMPENSATE_WRITE, fileio_write_pages(), double_write_block::flush_volumes_info, flush_volume_info::flushed_status, free_and_init, log_append_info::get_nxio_lsa(), i, double_write_slot::io_page, IO_PAGESIZE, log_Gl, logpb_need_wal(), double_write_slot::lsa, fileio_page_reserved::lsa, LSA_ISNULL(), LSA_LE(), double_write_buffer::next_block_to_flush, NO_ERROR, NULL, NULL_PAGEID, NULL_VOLDES, flush_volume_info::num_pages, fileio_page_reserved::p_reserve_2, fileio_page_reserved::pageid, PERFMON_ACTIVATION_FLAG_FLUSHED_BLOCK_VOLUMES, perfmon_add_stat(), perfmon_is_perf_tracking_and_active(), double_write_slot::position_in_block, double_write_buffer::position_with_flags, prm_get_integer_value(), PRM_ID_PB_SYNC_ON_NFLUSH, fileio_page::prv, PSTAT_DWB_FLUSH_BLOCK_SORT_TIME_COUNTERS, PSTAT_DWB_FLUSH_BLOCK_TIME_COUNTERS, PSTAT_DWB_WAIT_FILE_SYNC_HELPER_TIME_COUNTERS, PSTAT_PB_NUM_IOWRITES, SERVER_MODE, double_write_block::slots, STATIC_INLINE, thread_sleep(), flush_volume_info::vdes, double_write_buffer::vdes, double_write_block::version, VOLUME_FLUSHED_BY_DWB_FLUSH_THREAD, VOLUME_NOT_FLUSHED, double_write_slot::vpid, VPID_EQ, VPID_ISNULL, VPID_SET_NULL, and double_write_block::write_buffer.
Referenced by dwb_add_page(), dwb_flush_next_block(), and dwb_starts_structure_modification().
|
static |
Definition at line 4050 of file double_write_buffer.c.
References prm_get_bool_value(), and PRM_ID_ENABLE_DWB_FLUSH_THREAD.
Referenced by dwb_starts_structure_modification().
int dwb_flush_force | ( | THREAD_ENTRY * | thread_p, |
bool * | all_sync | ||
) |
Definition at line 3414 of file double_write_buffer.c.
References assert, double_write_buffer::blocks, double_write_buffer::blocks_flush_counter, double_write_block::count_wb_pages, dwb_add_page(), DWB_BLOCK_NUM_PAGES, DWB_GET_BLOCK_NO_FROM_POSITION, DWB_GET_BLOCK_STATUS, DWB_IS_BLOCK_WRITE_STARTED, DWB_IS_CREATED, DWB_IS_MODIFYING_STRUCTURE, dwb_log, dwb_log_error, DWB_NOT_CREATED_OR_MODIFYING, DWB_NUM_TOTAL_BLOCKS, dwb_wait_for_block_completion(), dwb_wait_for_strucure_modification(), ER_CSS_PTHREAD_COND_TIMEDOUT, double_write_buffer::file_sync_helper_block, fileio_initialize_res(), IO_MAX_PAGE_SIZE, IO_PAGESIZE, MAX_ALIGNMENT, double_write_buffer::next_block_to_flush, NO_ERROR, NULL, NULL_PAGEID, NULL_VOLID, double_write_buffer::position_with_flags, PSTAT_DWB_FLUSH_FORCE_TIME_COUNTERS, PTR_ALIGN, thread_sleep(), and double_write_block::version.
Referenced by disk_format(), fileio_synchronize(), and fileio_synchronize_all().
|
static |
Definition at line 3355 of file double_write_buffer.c.
References assert, assert_release, double_write_block::block_no, double_write_buffer::blocks, double_write_block::count_wb_pages, DWB_BLOCK_NUM_PAGES, dwb_flush_block(), dwb_get_next_block_for_flush(), DWB_GET_PREV_BLOCK, DWB_GET_PREV_BLOCK_NO, DWB_IS_CREATED, DWB_IS_MODIFYING_STRUCTURE, dwb_log, dwb_log_error, DWB_NUM_TOTAL_BLOCKS, NO_ERROR, NULL, double_write_buffer::position_with_flags, and double_write_block::version.
Referenced by dwb_read_page().
STATIC_INLINE void dwb_get_next_block_for_flush | ( | THREAD_ENTRY * | thread_p, |
unsigned int * | block_no | ||
) |
Definition at line 2631 of file double_write_buffer.c.
References assert, double_write_buffer::blocks, double_write_block::count_wb_pages, DWB_BLOCK_NUM_PAGES, DWB_NUM_TOTAL_BLOCKS, and double_write_buffer::next_block_to_flush.
Referenced by dwb_flush_next_block().
char* dwb_get_volume_name | ( | void | ) |
Definition at line 3336 of file double_write_buffer.c.
References dwb_is_created(), dwb_Volume_name, and NULL.
STATIC_INLINE void dwb_init_slot | ( | DWB_SLOT * | slot | ) |
Definition at line 2614 of file double_write_buffer.c.
References assert, double_write_slot::io_page, double_write_slot::lsa, LSA_SET_NULL(), NULL, STATIC_INLINE, double_write_slot::vpid, and VPID_SET_NULL.
Referenced by dwb_block_create_ordered_slots().
STATIC_INLINE void dwb_init_wait_queue | ( | DWB_WAIT_QUEUE * | wait_queue | ) |
Definition at line 449 of file double_write_buffer.c.
References double_write_wait_queue::count, double_write_wait_queue::free_count, double_write_wait_queue::free_list, double_write_wait_queue::head, NULL, STATIC_INLINE, and double_write_wait_queue::tail.
Referenced by dwb_create_internal(), and dwb_initialize_block().
STATIC_INLINE void dwb_initialize_block | ( | DWB_BLOCK * | block, |
unsigned int | block_no, | ||
unsigned int | count_wb_pages, | ||
char * | write_buffer, | ||
DWB_SLOT * | slots, | ||
FLUSH_VOLUME_INFO * | flush_volumes_info, | ||
unsigned int | count_flush_volumes_info, | ||
unsigned int | max_to_flush_vdes | ||
) |
Definition at line 963 of file double_write_buffer.c.
References double_write_block::all_pages_written, assert, double_write_block::block_no, double_write_block::count_flush_volumes_info, double_write_block::count_wb_pages, dwb_init_wait_queue(), double_write_block::flush_volumes_info, double_write_block::max_to_flush_vdes, double_write_block::mutex, pthread_mutex_init, double_write_block::slots, STATIC_INLINE, double_write_block::version, double_write_block::wait_queue, write_buffer(), and double_write_block::write_buffer.
Referenced by dwb_create_blocks().
STATIC_INLINE void dwb_initialize_slot | ( | DWB_SLOT * | slot, |
FILEIO_PAGE * | io_page, | ||
unsigned int | position_in_block, | ||
unsigned int | block_no | ||
) |
Definition at line 934 of file double_write_buffer.c.
References assert, double_write_slot::block_no, double_write_slot::io_page, double_write_slot::lsa, fileio_page_reserved::lsa, LSA_COPY(), fileio_page_reserved::pageid, double_write_slot::position_in_block, fileio_page::prv, STATIC_INLINE, fileio_page_reserved::volid, double_write_slot::vpid, and VPID_SET.
Referenced by dwb_create_blocks().
bool dwb_is_created | ( | void | ) |
Definition at line 2805 of file double_write_buffer.c.
References DWB_IS_CREATED, and double_write_buffer::position_with_flags.
Referenced by dwb_flush_block(), dwb_get_volume_name(), dwb_read_page(), fileio_initialize_pages(), fileio_write_or_add_to_dwb(), fileio_write_restore(), fileio_writev(), logpb_archive_active_log(), logpb_copy_database(), logpb_write_page_to_disk(), logpb_write_toflush_pages_to_archive(), logpb_writev_append_pages(), and pgbuf_bcb_flush_with_wal().
|
static |
Definition at line 4035 of file double_write_buffer.c.
References NULL, prm_get_bool_value(), and PRM_ID_ENABLE_DWB_FLUSH_THREAD.
Referenced by dwb_flush_block(), and dwb_write_block().
|
static |
Definition at line 4021 of file double_write_buffer.c.
References NULL, prm_get_bool_value(), and PRM_ID_ENABLE_DWB_FLUSH_THREAD.
Referenced by dwb_add_page().
int dwb_load_and_recover_pages | ( | THREAD_ENTRY * | thread_p, |
const char * | dwb_path_p, | ||
const char * | db_name_p | ||
) |
Definition at line 3095 of file double_write_buffer.c.
References assert, boot_db_full_name(), double_write_block::count_flush_volumes_info, double_write_block::count_wb_pages, dwb_block_create_ordered_slots(), dwb_check_data_page_is_sane(), dwb_check_logging, dwb_create(), dwb_create_blocks(), dwb_debug_check_dwb(), dwb_finalize_block(), dwb_log, dwb_log_error, dwb_Volume_name, dwb_write_block(), ER_FAILED, ER_IO_MOUNT_FAIL, fileio_dismount(), fileio_get_number_of_volume_pages(), fileio_is_volume_exist(), fileio_make_dwb_name(), fileio_mount(), fileio_read_pages(), FILEIO_SYNC_ONLY, fileio_synchronize(), fileio_unformat(), double_write_block::flush_volumes_info, free_and_init, i, double_write_slot::io_page, IO_PAGESIZE, IS_POWER_OF_2, LOG_DBDWB_VOLID, double_write_slot::lsa, fileio_page_reserved::lsa, LSA_COPY(), LSA_LE(), LSA_LT(), NO_ERROR, NULL, NULL_VOLDES, fileio_page_reserved::pageid, double_write_slot::position_in_block, fileio_page::prv, double_write_block::slots, flush_volume_info::vdes, double_write_buffer::vdes, fileio_page_reserved::volid, double_write_slot::vpid, VPID_EQ, VPID_ISNULL, VPID_SET, VPID_SET_NULL, and double_write_block::write_buffer.
Referenced by boot_restart_server().
STATIC_INLINE DWB_WAIT_QUEUE_ENTRY * dwb_make_wait_queue_entry | ( | DWB_WAIT_QUEUE * | wait_queue, |
void * | data | ||
) |
Definition at line 467 of file double_write_buffer.c.
References ARG_FILE_LINE, assert, double_write_wait_queue_entry::data, ER_ERROR_SEVERITY, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), double_write_wait_queue::free_count, double_write_wait_queue::free_list, double_write_wait_queue_entry::next, NULL, and STATIC_INLINE.
Referenced by dwb_block_add_wait_queue_entry().
int dwb_read_page | ( | THREAD_ENTRY * | thread_p, |
const VPID * | vpid, | ||
void * | io_page, | ||
bool * | success | ||
) |
Definition at line 3869 of file double_write_buffer.c.
References assert, assert_release, BO_IS_SERVER_RESTARTED, cubthread::manager::create_daemon(), cubthread::manager::destroy_daemon(), dwb_file_sync_helper(), dwb_flush_next_block(), dwb_is_created(), cubthread::lockfree_hashmap< Key, T >::find(), cubthread::get_manager(), double_write_slot::io_page, IO_PAGESIZE, dwb_slots_hash_entry::mutex, NO_ERROR, NULL, fileio_page_reserved::pageid, vpid::pageid, prm_get_bool_value(), PRM_ID_ENABLE_DWB_FLUSH_THREAD, fileio_page::prv, PSTAT_DWB_FLUSH_BLOCK_COND_WAIT, pthread_mutex_unlock, dwb_slots_hash_entry::slot, double_write_buffer::slots_hashmap, fileio_page_reserved::volid, vpid::volid, double_write_slot::vpid, and VPID_EQ.
Referenced by pgbuf_claim_bcb_for_fix().
int dwb_recreate | ( | THREAD_ENTRY * | thread_p | ) |
Definition at line 2863 of file double_write_buffer.c.
References dwb_create_internal(), dwb_destroy_internal(), dwb_ends_structure_modification(), DWB_IS_CREATED, dwb_starts_structure_modification(), dwb_Volume_name, NO_ERROR, and thread_get_thread_entry_info().
STATIC_INLINE void dwb_remove_wait_queue_entry | ( | DWB_WAIT_QUEUE * | wait_queue, |
pthread_mutex_t * | mutex, | ||
void * | data, | ||
int(*)(void *) | func | ||
) |
Definition at line 632 of file double_write_buffer.c.
References dwb_block_disconnect_wait_queue_entry(), dwb_block_free_wait_queue_entry(), NULL, pthread_mutex_lock, pthread_mutex_unlock, and STATIC_INLINE.
Referenced by dwb_signal_waiting_threads(), dwb_wait_for_block_completion(), and dwb_wait_for_strucure_modification().
int dwb_set_data_on_next_slot | ( | THREAD_ENTRY * | thread_p, |
FILEIO_PAGE * | io_page_p, | ||
bool | can_wait, | ||
DWB_SLOT ** | p_dwb_slot | ||
) |
Definition at line 2657 of file double_write_buffer.c.
References assert, dwb_acquire_next_slot(), dwb_set_slot_data(), and NO_ERROR.
Referenced by dwb_add_page(), and pgbuf_bcb_flush_with_wal().
STATIC_INLINE void dwb_set_slot_data | ( | THREAD_ENTRY * | thread_p, |
DWB_SLOT * | dwb_slot, | ||
FILEIO_PAGE * | io_page_p | ||
) |
Definition at line 2586 of file double_write_buffer.c.
References assert, fileio_initialize_res(), fileio_is_page_sane(), double_write_slot::io_page, IO_PAGESIZE, double_write_slot::lsa, fileio_page_reserved::lsa, LSA_COPY(), NULL_PAGEID, fileio_page_reserved::p_reserve_2, fileio_page_reserved::pageid, fileio_page::prv, STATIC_INLINE, fileio_page_reserved::volid, double_write_slot::vpid, and VPID_SET.
Referenced by dwb_set_data_on_next_slot().
STATIC_INLINE int dwb_set_status_resumed | ( | void * | data | ) |
Definition at line 1507 of file double_write_buffer.c.
References double_write_wait_queue_entry::data, if(), NO_ERROR, STATIC_INLINE, THREAD_DWB_QUEUE_RESUMED, thread_lock_entry(), and thread_unlock_entry().
Referenced by dwb_wait_for_block_completion().
STATIC_INLINE void dwb_signal_block_completion | ( | THREAD_ENTRY * | thread_p, |
DWB_BLOCK * | dwb_block | ||
) |
Definition at line 1662 of file double_write_buffer.c.
References assert, dwb_signal_waiting_threads(), double_write_block::mutex, STATIC_INLINE, and double_write_block::wait_queue.
Referenced by dwb_flush_block().
STATIC_INLINE void dwb_signal_structure_modificated | ( | THREAD_ENTRY * | thread_p | ) |
Definition at line 1677 of file double_write_buffer.c.
References dwb_signal_waiting_threads(), double_write_buffer::mutex, STATIC_INLINE, and double_write_buffer::wait_queue.
Referenced by dwb_ends_structure_modification().
STATIC_INLINE int dwb_signal_waiting_thread | ( | void * | data | ) |
Definition at line 1629 of file double_write_buffer.c.
References assert, double_write_wait_queue_entry::data, if(), NO_ERROR, STATIC_INLINE, THREAD_DWB_QUEUE_RESUMED, THREAD_DWB_QUEUE_SUSPENDED, thread_lock_entry(), thread_unlock_entry(), and thread_wakeup_already_had_mutex().
Referenced by dwb_signal_waiting_threads().
STATIC_INLINE void dwb_signal_waiting_threads | ( | DWB_WAIT_QUEUE * | wait_queue, |
pthread_mutex_t * | mutex | ||
) |
Definition at line 661 of file double_write_buffer.c.
References assert, dwb_remove_wait_queue_entry(), dwb_signal_waiting_thread(), double_write_wait_queue::head, pthread_mutex_lock, pthread_mutex_unlock, and STATIC_INLINE.
Referenced by dwb_destroy_wait_queue(), dwb_signal_block_completion(), and dwb_signal_structure_modificated().
|
static |
Definition at line 1334 of file double_write_buffer.c.
References VPID_EQ.
STATIC_INLINE int dwb_slots_hash_delete | ( | THREAD_ENTRY * | thread_p, |
DWB_SLOT * | slot | ||
) |
Definition at line 1869 of file double_write_buffer.c.
References assert, assert_release, dwb_log_error, cubthread::lockfree_hashmap< Key, T >::erase_locked(), cubthread::lockfree_hashmap< Key, T >::find(), double_write_slot::io_page, dwb_slots_hash_entry::mutex, NO_ERROR, NULL, fileio_page_reserved::pageid, vpid::pageid, fileio_page::prv, pthread_mutex_unlock, dwb_slots_hash_entry::slot, double_write_buffer::slots_hashmap, fileio_page_reserved::volid, vpid::volid, double_write_slot::vpid, VPID_EQ, and VPID_ISNULL.
Referenced by dwb_write_block().
|
static |
Definition at line 1250 of file double_write_buffer.c.
References ARG_FILE_LINE, ER_ERROR_SEVERITY, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), dwb_slots_hash_entry::mutex, NULL, and pthread_mutex_init.
|
static |
Definition at line 1272 of file double_write_buffer.c.
References ER_FAILED, dwb_slots_hash_entry::mutex, NO_ERROR, and pthread_mutex_destroy.
|
static |
Definition at line 1293 of file double_write_buffer.c.
References ER_FAILED, NO_ERROR, NULL, dwb_slots_hash_entry::slot, dwb_slots_hash_entry::vpid, and VPID_SET_NULL.
STATIC_INLINE int dwb_slots_hash_insert | ( | THREAD_ENTRY * | thread_p, |
VPID * | vpid, | ||
DWB_SLOT * | slot, | ||
bool * | inserted | ||
) |
Definition at line 1369 of file double_write_buffer.c.
References assert, double_write_slot::block_no, double_write_block::block_no, double_write_buffer::blocks, dwb_log, fileio_initialize_res(), cubthread::lockfree_hashmap< Key, T >::find_or_insert(), double_write_slot::io_page, IO_PAGESIZE, double_write_slot::lsa, LSA_EQ(), LSA_LT(), dwb_slots_hash_entry::mutex, new_block(), NO_ERROR, NULL, log_lsa::offset, log_lsa::pageid, fileio_page_reserved::pageid, vpid::pageid, double_write_slot::position_in_block, fileio_page::prv, pthread_mutex_unlock, dwb_slots_hash_entry::slot, double_write_buffer::slots_hashmap, STATIC_INLINE, double_write_block::version, fileio_page_reserved::volid, vpid::volid, double_write_slot::vpid, dwb_slots_hash_entry::vpid, VPID_EQ, and VPID_SET_NULL.
Referenced by dwb_add_page().
|
static |
Definition at line 1352 of file double_write_buffer.c.
References vpid::pageid, STATIC_INLINE, and vpid::volid.
|
static |
Definition at line 1315 of file double_write_buffer.c.
STATIC_INLINE int dwb_starts_structure_modification | ( | THREAD_ENTRY * | thread_p, |
UINT64 * | current_position_with_flags | ||
) |
Definition at line 807 of file double_write_buffer.c.
References assert, double_write_block::block_no, double_write_buffer::blocks, double_write_buffer::blocks_flush_counter, dwb_file_sync_helper_daemon_is_running(), dwb_flush_block(), dwb_flush_block_daemon_is_running(), DWB_GET_BLOCK_STATUS, DWB_IS_BLOCK_WRITE_STARTED, DWB_IS_MODIFYING_STRUCTURE, dwb_log, dwb_log_error, DWB_NUM_TOTAL_BLOCKS, DWB_STARTS_MODIFYING_STRUCTURE, ER_FAILED, double_write_buffer::file_sync_helper_block, NO_ERROR, NULL, double_write_buffer::position_with_flags, STATIC_INLINE, thread_sleep(), and double_write_block::version.
Referenced by dwb_create(), dwb_destroy(), and dwb_recreate().
STATIC_INLINE int dwb_wait_for_block_completion | ( | THREAD_ENTRY * | thread_p, |
unsigned int | block_no | ||
) |
Definition at line 1538 of file double_write_buffer.c.
References ARG_FILE_LINE, assert, ASSERT_ERROR_AND_SET, double_write_buffer::blocks, dwb_block_add_wait_queue_entry(), DWB_IS_BLOCK_WRITE_STARTED, DWB_NUM_TOTAL_BLOCKS, dwb_remove_wait_queue_entry(), dwb_set_status_resumed(), ER_CSS_PTHREAD_COND_TIMEDOUT, ER_ERROR_SEVERITY, ER_INTERRUPTED, er_set(), logtb_set_check_interrupt(), double_write_block::mutex, NO_ERROR, NULL, double_write_buffer::position_with_flags, PSTAT_DWB_WAIT_FLUSH_BLOCK_TIME_COUNTERS, pthread_mutex_lock, pthread_mutex_unlock, STATIC_INLINE, THREAD_DWB_QUEUE_RESUMED, THREAD_DWB_QUEUE_SUSPENDED, thread_lock_entry(), THREAD_RESUME_DUE_TO_SHUTDOWN, thread_suspend_timeout_wakeup_and_unlock_entry(), thread_unlock_entry(), timeval_add_msec(), timeval_to_timespec(), and double_write_block::wait_queue.
Referenced by dwb_acquire_next_slot(), and dwb_flush_force().
STATIC_INLINE int dwb_wait_for_strucure_modification | ( | THREAD_ENTRY * | thread_p | ) |
Definition at line 1690 of file double_write_buffer.c.
References ARG_FILE_LINE, assert, ASSERT_ERROR_AND_SET, dwb_block_add_wait_queue_entry(), DWB_IS_MODIFYING_STRUCTURE, dwb_remove_wait_queue_entry(), ER_CSS_PTHREAD_COND_TIMEDOUT, ER_ERROR_SEVERITY, ER_INTERRUPTED, er_set(), logtb_set_check_interrupt(), double_write_buffer::mutex, NO_ERROR, NULL, double_write_buffer::position_with_flags, pthread_mutex_lock, pthread_mutex_unlock, THREAD_DWB_QUEUE_RESUMED, THREAD_DWB_QUEUE_SUSPENDED, thread_lock_entry(), THREAD_RESUME_DUE_TO_SHUTDOWN, thread_suspend_timeout_wakeup_and_unlock_entry(), thread_unlock_entry(), timeval_add_msec(), timeval_to_timespec(), and double_write_buffer::wait_queue.
Referenced by dwb_acquire_next_slot(), and dwb_flush_force().
STATIC_INLINE int dwb_write_block | ( | THREAD_ENTRY * | thread_p, |
DWB_BLOCK * | block, | ||
DWB_SLOT * | p_dwb_slots, | ||
unsigned int | ordered_slots_length, | ||
bool | file_sync_helper_can_flush, | ||
bool | remove_from_hash | ||
) |
Definition at line 1991 of file double_write_buffer.c.
References flush_volume_info::all_pages_written, assert, ASSERT_ERROR, assert_release, double_write_block::count_flush_volumes_info, double_write_block::count_wb_pages, dwb_add_volume_to_block_flush_area(), DWB_BLOCK_NUM_PAGES, dwb_is_file_sync_helper_daemon_available(), dwb_log, dwb_log_error, dwb_slots_hash_delete(), er_errid(), ER_FAILED, double_write_buffer::file_sync_helper_block, fileio_get_volume_descriptor(), fileio_write(), FILEIO_WRITE_NO_COMPENSATE_WRITE, double_write_block::flush_volumes_info, i, double_write_slot::io_page, IO_PAGESIZE, fileio_page_reserved::lsa, NO_ERROR, NULL, NULL_VOLDES, NULL_VOLID, flush_volume_info::num_pages, log_lsa::offset, log_lsa::pageid, fileio_page_reserved::pageid, vpid::pageid, perfmon_add_stat(), double_write_slot::position_in_block, prm_get_integer_value(), PRM_ID_PB_SYNC_ON_NFLUSH, fileio_page::prv, PSTAT_DWB_DECACHE_PAGES_AFTER_WRITE, PSTAT_PB_NUM_IOWRITES, double_write_block::slots, STATIC_INLINE, flush_volume_info::vdes, fileio_page_reserved::volid, vpid::volid, double_write_slot::vpid, VPID_ISNULL, VPID_LT, and cubthread::daemon::wakeup().
Referenced by dwb_flush_block(), and dwb_load_and_recover_pages().
|
static |
Definition at line 306 of file double_write_buffer.c.
char dwb_Volume_name[PATH_MAX] |
Definition at line 303 of file double_write_buffer.c.
Referenced by dwb_create(), dwb_destroy_internal(), dwb_flush_block(), dwb_get_volume_name(), dwb_load_and_recover_pages(), and dwb_recreate().
|
static |
Definition at line 421 of file double_write_buffer.c.