43 #define DWB_SLOTS_HASH_SIZE 1000 44 #define DWB_SLOTS_FREE_LIST_SIZE 100 46 #define DWB_MIN_SIZE (512 * 1024) 47 #define DWB_MAX_SIZE (32 * 1024 * 1024) 48 #define DWB_MIN_BLOCKS 1 49 #define DWB_MAX_BLOCKS 32 52 #define DWB_NUM_TOTAL_BLOCKS (dwb_Global.num_blocks) 55 #define DWB_NUM_TOTAL_PAGES (dwb_Global.num_pages) 58 #define DWB_BLOCK_NUM_PAGES (dwb_Global.num_block_pages) 61 #define DWB_LOG2_BLOCK_NUM_PAGES (dwb_Global.log2_num_block_pages) 65 #define DWB_POSITION_MASK 0x000000003fffffff 68 #define DWB_BLOCKS_STATUS_MASK 0xffffffff00000000 71 #define DWB_MODIFY_STRUCTURE 0x0000000080000000 74 #define DWB_CREATE 0x0000000040000000 77 #define DWB_CREATE_OR_MODIFY_MASK (DWB_CREATE | DWB_MODIFY_STRUCTURE) 80 #define DWB_FLAG_MASK (DWB_BLOCKS_STATUS_MASK | DWB_MODIFY_STRUCTURE | DWB_CREATE) 84 #define DWB_GET_POSITION(position_with_flags) \ 85 ((position_with_flags) & DWB_POSITION_MASK) 88 #define DWB_RESET_POSITION(position_with_flags) \ 89 ((position_with_flags) & DWB_FLAG_MASK) 92 #define DWB_GET_BLOCK_STATUS(position_with_flags) \ 93 ((position_with_flags) & DWB_BLOCKS_STATUS_MASK) 96 #define DWB_GET_BLOCK_NO_FROM_POSITION(position_with_flags) \ 97 ((unsigned int) DWB_GET_POSITION (position_with_flags) >> (DWB_LOG2_BLOCK_NUM_PAGES)) 100 #define DWB_IS_BLOCK_WRITE_STARTED(position_with_flags, block_no) \ 101 (assert (block_no < DWB_MAX_BLOCKS), ((position_with_flags) & (1ULL << (63 - (block_no)))) != 0) 104 #define DWB_IS_ANY_BLOCK_WRITE_STARTED(position_with_flags) \ 105 (((position_with_flags) & DWB_BLOCKS_STATUS_MASK) != 0) 108 #define DWB_STARTS_BLOCK_WRITING(position_with_flags, block_no) \ 109 (assert (block_no < DWB_MAX_BLOCKS), (position_with_flags) | (1ULL << (63 - (block_no)))) 112 #define DWB_ENDS_BLOCK_WRITING(position_with_flags, block_no) \ 113 (assert (DWB_IS_BLOCK_WRITE_STARTED (position_with_flags, block_no)), \ 114 (position_with_flags) & ~(1ULL << (63 - (block_no)))) 117 #define DWB_STARTS_MODIFYING_STRUCTURE(position_with_flags) \ 118 ((position_with_flags) | DWB_MODIFY_STRUCTURE) 121 #define DWB_ENDS_MODIFYING_STRUCTURE(position_with_flags) \ 122 (assert (DWB_IS_MODIFYING_STRUCTURE (position_with_flags)), (position_with_flags) & ~DWB_MODIFY_STRUCTURE) 125 #define DWB_IS_MODIFYING_STRUCTURE(position_with_flags) \ 126 (((position_with_flags) & DWB_MODIFY_STRUCTURE) != 0) 129 #define DWB_STARTS_CREATION(position_with_flags) \ 130 ((position_with_flags) | DWB_CREATE) 133 #define DWB_ENDS_CREATION(position_with_flags) \ 134 (assert (DWB_IS_CREATED (position_with_flags)), (position_with_flags) & ~DWB_CREATE) 137 #define DWB_IS_CREATED(position_with_flags) \ 138 (((position_with_flags) & DWB_CREATE) != 0) 141 #define DWB_NOT_CREATED_OR_MODIFYING(position_with_flags) \ 142 (((position_with_flags) & DWB_CREATE_OR_MODIFY_MASK) != DWB_CREATE) 145 #define DWB_GET_NEXT_POSITION_WITH_FLAGS(position_with_flags) \ 146 ((DWB_GET_POSITION (position_with_flags)) == (DWB_NUM_TOTAL_PAGES - 1) \ 147 ? ((position_with_flags) & DWB_FLAG_MASK) : ((position_with_flags) + 1)) 150 #define DWB_GET_POSITION_IN_BLOCK(position_with_flags) \ 151 ((DWB_GET_POSITION (position_with_flags)) & (DWB_BLOCK_NUM_PAGES - 1)) 154 #define DWB_GET_PREV_BLOCK_NO(block_no) \ 155 ((block_no) > 0 ? ((block_no) - 1) : (DWB_NUM_TOTAL_BLOCKS - 1)) 158 #define DWB_GET_PREV_BLOCK(block_no) \ 159 (&(dwb_Global.blocks[DWB_GET_PREV_BLOCK_NO(block_no)])) 162 #define DWB_GET_NEXT_BLOCK_NO(block_no) \ 163 ((block_no) == (DWB_NUM_TOTAL_BLOCKS - 1) ? 0 : ((block_no) + 1)) 166 #define DWB_GET_BLOCK_VERSION(block) \ 167 (ATOMIC_INC_64 (&block->version, 0ULL)) 188 #define DWB_WAIT_QUEUE_INITIALIZER {NULL, NULL, NULL, 0, 0} 283 : logging_enabled (false)
287 , num_block_pages (0)
288 , log2_num_block_pages (0)
289 , blocks_flush_counter (0)
290 , next_block_to_flush (0)
291 , mutex PTHREAD_MUTEX_INITIALIZER
293 , position_with_flags (0)
296 , file_sync_helper_block (
NULL)
308 #define dwb_Log dwb_Global.logging_enabled 310 #define dwb_check_logging() (dwb_Log = prm_get_bool_value (PRM_ID_DWB_LOGGING)) 311 #define dwb_log(...) if (dwb_Log) _er_log_debug (ARG_FILE_LINE, "DWB: " __VA_ARGS__) 312 #define dwb_log_error(...) if (dwb_Log) _er_log_debug (ARG_FILE_LINE, "DWB ERROR: " __VA_ARGS__) 314 #if !defined(SERVER_MODE) 315 #define pthread_mutex_init(a, b) 316 #define pthread_mutex_destroy(a) 317 #define pthread_mutex_lock(a) 0 318 #define pthread_mutex_unlock(a) 328 wait_queue,
void *
data)
349 unsigned int *p_ordered_slots_length)
__attribute__ ((ALWAYS_INLINE));
354 unsigned int ordered_slots_length,
bool file_sync_helper_can_flush,
357 UINT64 * current_position_with_flags)
__attribute__ ((ALWAYS_INLINE));
372 unsigned int position_in_block,
unsigned int block_no)
377 unsigned int max_to_flush_vdes)
__attribute__ ((ALWAYS_INLINE));
382 UINT64 * current_position_with_flags)
__attribute__ ((ALWAYS_INLINE));
399 #if defined (SERVER_MODE) 414 #if !defined (NDEBUG) 418 int *p_num_recoverable_pages);
453 wait_queue->
count = 0;
471 assert (wait_queue != NULL && data != NULL);
475 wait_queue_entry = wait_queue->
free_list;
482 if (wait_queue_entry == NULL)
491 return wait_queue_entry;
508 assert (wait_queue != NULL && data != NULL);
511 if (wait_queue_entry == NULL)
516 if (wait_queue->
head == NULL)
518 wait_queue->
tail = wait_queue->
head = wait_queue_entry;
522 wait_queue->
tail->
next = wait_queue_entry;
523 wait_queue->
tail = wait_queue_entry;
527 return wait_queue_entry;
543 assert (wait_queue != NULL);
545 if (wait_queue->
head == NULL)
550 prev_wait_queue_entry =
NULL;
551 wait_queue_entry = wait_queue->
head;
555 while (wait_queue_entry != NULL)
557 if (wait_queue_entry->
data == data)
561 prev_wait_queue_entry = wait_queue_entry;
562 wait_queue_entry = wait_queue_entry->
next;
566 if (wait_queue_entry == NULL)
571 if (prev_wait_queue_entry != NULL)
573 prev_wait_queue_entry->next = wait_queue_entry->
next;
577 assert (wait_queue_entry == wait_queue->
head);
578 wait_queue->
head = wait_queue_entry->
next;
581 if (wait_queue_entry == wait_queue->
tail)
583 wait_queue->
tail = prev_wait_queue_entry;
589 return wait_queue_entry;
602 int (*func) (
void *))
604 if (wait_queue_entry == NULL)
611 (void) func (wait_queue_entry);
616 wait_queue->
free_list = wait_queue_entry;
642 if (wait_queue_entry != NULL)
663 assert (wait_queue != NULL);
670 while (wait_queue->
head != NULL)
693 assert (wait_queue != NULL);
706 wait_queue_entry = wait_queue->
free_list;
731 unsigned int min_size;
732 unsigned int max_size;
734 assert (p_double_write_buffer_size != NULL && p_num_blocks != NULL
735 && *p_double_write_buffer_size > 0 && *p_num_blocks > 0);
740 if (*p_double_write_buffer_size < min_size)
742 *p_double_write_buffer_size = min_size;
744 else if (*p_double_write_buffer_size > min_size)
746 if (*p_double_write_buffer_size > max_size)
748 *p_double_write_buffer_size = max_size;
753 unsigned int limit1 = min_size;
755 while (*p_double_write_buffer_size > limit1)
762 limit1 = limit1 << 1;
765 *p_double_write_buffer_size = limit1;
772 assert (*p_num_blocks >= min_size);
774 if (*p_num_blocks > min_size)
776 if (*p_num_blocks > max_size)
778 *p_num_blocks = max_size;
782 unsigned int num_blocks = *p_num_blocks;
786 num_blocks = num_blocks & (num_blocks - 1);
790 *p_num_blocks = num_blocks << 1;
792 assert (*p_num_blocks <= max_size);
809 UINT64 local_current_position_with_flags, new_position_with_flags, min_version;
810 unsigned int block_no;
812 unsigned int start_block_no, blocks_count;
815 assert (current_position_with_flags != NULL);
829 while (!ATOMIC_CAS_64 (&dwb_Global.
position_with_flags, local_current_position_with_flags, new_position_with_flags));
831 #if defined(SERVER_MODE) 842 if (file_sync_helper_block != NULL)
846 dwb_log (
"Structure modification, needs to flush DWB block = %d having version %lld\n",
854 min_version = 0xffffffffffffffff;
863 start_block_no = block_no;
869 block_no = start_block_no;
870 while (blocks_count > 0)
880 dwb_log_error (
"Can't flush block = %d having version %lld\n", block_no,
890 block_no = (block_no + 1) % DWB_NUM_TOTAL_BLOCKS;
896 *current_position_with_flags = local_current_position_with_flags;
911 UINT64 new_position_with_flags;
936 assert (slot != NULL && io_page != NULL);
965 unsigned int max_to_flush_vdes)
977 block->
slots = slots;
1001 unsigned int block_buffer_size,
i, j;
1011 blocks_write_buffer[
i] =
NULL;
1013 flush_volumes_info[
i] =
NULL;
1023 memset (blocks, 0, num_blocks *
sizeof (
DWB_BLOCK));
1025 block_buffer_size = num_block_pages *
IO_PAGESIZE;
1026 for (i = 0; i < num_blocks; i++)
1028 blocks_write_buffer[
i] = (
char *) malloc (block_buffer_size *
sizeof (
char));
1029 if (blocks_write_buffer[i] == NULL)
1035 memset (blocks_write_buffer[i], 0, block_buffer_size *
sizeof (
char));
1038 for (i = 0; i < num_blocks; i++)
1041 if (slots[i] == NULL)
1047 memset (slots[i], 0, num_block_pages *
sizeof (
DWB_SLOT));
1050 for (i = 0; i < num_blocks; i++)
1053 if (flush_volumes_info[i] == NULL)
1060 memset (flush_volumes_info[i], 0, num_block_pages *
sizeof (
FLUSH_VOLUME_INFO));
1063 for (i = 0; i < num_blocks; i++)
1066 for (j = 0; j < num_block_pages; j++)
1068 io_page = (
FILEIO_PAGE *) (blocks_write_buffer[i] + j * IO_PAGESIZE);
1074 dwb_initialize_block (&blocks[i], i, 0, blocks_write_buffer[i], slots[i], flush_volumes_info[i], 0,
1085 if (slots[i] != NULL)
1090 if (blocks_write_buffer[i] != NULL)
1095 if (flush_volumes_info[i] != NULL)
1118 if (block->
slots != NULL)
1151 unsigned int double_write_buffer_size, num_blocks = 0;
1152 unsigned int i, num_pages, num_block_pages;
1155 UINT64 new_position_with_flags;
1157 const int freelist_block_count = 2;
1160 assert (dwb_volume_name != NULL && current_position_with_flags != NULL);
1164 if (double_write_buffer_size == 0 || num_blocks == 0)
1172 num_pages = double_write_buffer_size /
IO_PAGESIZE;
1173 num_block_pages = num_pages / num_blocks;
1192 error_code =
dwb_create_blocks (thread_p, num_blocks, num_block_pages, &blocks);
1198 dwb_Global.
blocks = blocks;
1202 dwb_Global.
log2_num_block_pages = (
unsigned int) (log ((
float) num_block_pages) / log ((
float) 2));
1207 dwb_Global.
vdes = vdes;
1211 freelist_block_count, slots_entry_Descriptor);
1216 if (!ATOMIC_CAS_64 (&dwb_Global.
position_with_flags, *current_position_with_flags, new_position_with_flags))
1221 *current_position_with_flags = new_position_with_flags;
1234 for (i = 0; i < num_blocks; i++)
1255 if (slots_hash_entry == NULL)
1263 return (
void *) slots_hash_entry;
1276 if (slots_hash_entry == NULL)
1297 if (p_entry == NULL)
1317 if (src == NULL || dest == NULL)
1356 return ((vpid->
pageid | ((
unsigned int) vpid->
volid) << 24) % hash_table_size);
1374 assert (vpid != NULL && slot != NULL && inserted != NULL);
1388 dwb_log (
"DWB hash find key (%d, %d), the LSA=(%lld,%d), better than (%lld,%d): \n",
1409 dwb_log (
"Found same page with same LSA in same block - %d - at positions (%d, %d) \n",
1414 #if !defined (NDEBUG) 1415 int old_block_no = ATOMIC_INC_32 (&slots_hash_entry->
slot->
block_no, 0);
1416 if (old_block_no > 0)
1426 dwb_log (
"Found same page with same LSA in 2 different blocks old = (%d, %d), new = (%d,%d) \n",
1434 dwb_log (
"Replace hash key (%d, %d), the new LSA=(%lld,%d), the old LSA = (%lld,%d)",
1444 slots_hash_entry->
slot = slot;
1462 UINT64 new_position_with_flags;
1463 unsigned int block_no;
1465 assert (current_position_with_flags != NULL);
1470 if (dwb_Global.
blocks != NULL)
1491 if (!ATOMIC_CAS_64 (&dwb_Global.
position_with_flags, *current_position_with_flags, new_position_with_flags))
1497 *current_position_with_flags = new_position_with_flags;
1509 #if defined (SERVER_MODE) 1513 if (queue_entry != NULL)
1516 if (woken_thread_p != NULL)
1540 #if defined (SERVER_MODE) 1544 PERF_UTIME_TRACKER time_track;
1545 UINT64 current_position_with_flags;
1547 struct timeval timeval_crt, timeval_timeout;
1549 bool save_check_interrupt;
1553 PERF_UTIME_TRACKER_START (thread_p, &time_track);
1555 dwb_block = &dwb_Global.
blocks[block_no];
1573 if (double_write_queue_entry == NULL)
1587 gettimeofday (&timeval_crt, NULL);
1631 #if defined (SERVER_MODE) 1635 assert (wait_queue_entry != NULL);
1664 assert (dwb_block != NULL);
1692 #if defined (SERVER_MODE) 1695 UINT64 current_position_with_flags;
1697 struct timeval timeval_crt, timeval_timeout;
1699 bool save_check_interrupt;
1714 if (double_write_queue_entry == NULL)
1728 gettimeofday (&timeval_crt, NULL);
1832 unsigned int *p_ordered_slots_length)
1836 assert (block != NULL && p_dwb_ordered_slots != NULL);
1840 if (p_local_dwb_ordered_slots == NULL)
1855 *p_dwb_ordered_slots = p_local_dwb_ordered_slots;
1884 if (slots_hash_entry == NULL)
1893 if (slots_hash_entry->
slot == slot)
1926 int *vol_fd1 = (
int *) v1;
1927 int *vol_fd2 = (
int *) v2;
1929 assert (vol_fd1 != NULL && vol_fd2 != NULL);
1931 return ((*vol_fd1) - (*vol_fd2));
1948 #if !defined (NDEBUG) 1949 unsigned int old_count_flush_volumes_info;
1955 #if !defined (NDEBUG) 1961 flush_new_volume_info->
vdes = vol_fd;
1974 return flush_new_volume_info;
1992 unsigned int ordered_slots_length,
bool file_sync_helper_can_flush,
bool remove_from_hash)
1994 VOLID last_written_volid;
1996 int last_written_vol_fd, vol_fd;
1999 int count_writes = 0, num_pages_to_sync;
2001 bool can_flush_volume =
false;
2003 assert (block != NULL && p_dwb_ordered_slots != NULL);
2021 vpid = &p_dwb_ordered_slots[
i].
vpid;
2029 if (last_written_volid != vpid->
volid)
2032 if (current_flush_volume_info != NULL)
2036 can_flush_volume =
true;
2038 current_flush_volume_info =
NULL;
2048 last_written_volid = vpid->
volid;
2049 last_written_vol_fd = vol_fd;
2056 assert (p_dwb_ordered_slots[i].io_page->prv.p_reserve_2 == 0);
2065 dwb_log_error (
"DWB write page VPID=(%d, %d) LSA=(%lld,%d) with %d error: \n",
2073 dwb_log (
"dwb_write_block: written page = (%d,%d) LSA=(%lld,%d)\n",
2077 #if defined (SERVER_MODE) 2078 assert (current_flush_volume_info != NULL);
2080 ATOMIC_INC_32 (¤t_flush_volume_info->
num_pages, 1);
2083 if (file_sync_helper_can_flush && (count_writes >= num_pages_to_sync || can_flush_volume ==
true)
2088 dwb_file_sync_helper_daemon->
wakeup ();
2094 can_flush_volume =
false;
2100 if (current_flush_volume_info != NULL)
2105 #if !defined (NDEBUG) 2113 #if defined (SERVER_MODE) 2121 dwb_file_sync_helper_daemon->
wakeup ();
2130 if (remove_from_hash)
2132 PERF_UTIME_TRACKER time_track;
2134 PERF_UTIME_TRACKER_START (thread_p, &time_track);
2138 vpid = &p_dwb_ordered_slots[
i].
vpid;
2171 UINT64 * current_position_with_flags)
2173 UINT64 local_current_position_with_flags, new_position_with_flags;
2176 unsigned int i, ordered_slots_length;
2177 PERF_UTIME_TRACKER time_track;
2179 unsigned int current_block_to_flush, next_block_to_flush;
2180 int max_pages_to_sync;
2181 #if defined (SERVER_MODE) 2183 PERF_UTIME_TRACKER time_track_file_sync_helper;
2185 #if !defined (NDEBUG) 2192 PERF_UTIME_TRACKER_START (thread_p, &time_track);
2211 s1 = &p_dwb_ordered_slots[
i];
2212 s2 = &p_dwb_ordered_slots[i + 1];
2232 #if !defined (NDEBUG) 2244 #if !defined (NDEBUG) 2249 PERF_UTIME_TRACKER_START (thread_p, &time_track_file_sync_helper);
2274 dwb_log (
"dwb_flush_block: Synchronized volume %d\n",
2282 #if !defined (NDEBUG) 2283 if (saved_file_sync_helper_block)
2322 dwb_log (
"dwb_flush_block: DWB synchronized\n");
2326 dwb_write_block (thread_p, block, p_dwb_ordered_slots, ordered_slots_length, file_sync_helper_can_flush,
true);
2347 #if defined (SERVER_MODE) 2348 if (file_sync_helper_can_flush ==
true)
2391 ATOMIC_INC_64 (&block->
version, 1ULL);
2398 if (!ATOMIC_CAS_64 (&dwb_Global.
position_with_flags, local_current_position_with_flags, new_position_with_flags))
2401 goto reset_bit_position;
2408 if (!ATOMIC_CAS_32 (&dwb_Global.
next_block_to_flush, current_block_to_flush, next_block_to_flush))
2416 if (current_position_with_flags)
2418 *current_position_with_flags = new_position_with_flags;
2424 if (p_dwb_ordered_slots != NULL)
2445 UINT64 current_position_with_flags, current_position_with_block_write_started, new_position_with_flags;
2446 unsigned int current_block_no, position_in_current_block;
2450 assert (p_dwb_slot != NULL);
2462 if (can_wait ==
false)
2505 if (position_in_current_block == 0)
2510 if (can_wait ==
false)
2515 dwb_log (
"Waits for flushing block=%d having version=%lld) \n",
2516 current_block_no, dwb_Global.
blocks[current_block_no].
version);
2531 dwb_log_error (
"Error %d while waiting for flushing block=%d having version %lld \n",
2532 error_code, current_block_no, dwb_Global.
blocks[current_block_no].
version);
2543 current_position_with_block_write_started =
2559 if (!ATOMIC_CAS_64 (&dwb_Global.
position_with_flags, current_position_with_flags, new_position_with_flags))
2565 block = dwb_Global.
blocks + current_block_no;
2567 *p_dwb_slot = block->
slots + position_in_current_block;
2572 assert ((*p_dwb_slot)->position_in_block == position_in_current_block);
2588 assert (dwb_slot != NULL && io_page_p != NULL);
2633 assert (block_no != NULL);
2661 assert (p_dwb_slot != NULL && io_page_p != NULL);
2670 assert (can_wait ==
false || *p_dwb_slot != NULL);
2671 if (*p_dwb_slot == NULL)
2697 unsigned int count_wb_pages;
2699 bool inserted =
false;
2704 assert (p_dwb_slot != NULL && (io_page_p != NULL || (*p_dwb_slot)->io_page != NULL) && vpid != NULL);
2706 if (thread_p == NULL)
2711 if (*p_dwb_slot == NULL)
2719 if (*p_dwb_slot == NULL)
2725 dwb_slot = *p_dwb_slot;
2744 dwb_log (
"dwb_add_page: added page = (%d,%d) on block (%d) position (%d)\n", vpid->
volid, vpid->
pageid,
2753 needs_flush =
false;
2760 if (needs_flush ==
false)
2771 #if defined (SERVER_MODE) 2779 dwb_flush_block_daemon->wakeup ();
2823 UINT64 current_position_with_flags;
2829 dwb_log_error (
"Can't create DWB: error = %d\n", error_code);
2845 dwb_log_error (
"Can't create DWB: error = %d\n", error_code);
2866 UINT64 current_position_with_flags;
2868 if (thread_p == NULL)
2898 #if !defined (NDEBUG) 2915 bool is_page_corrupted;
2921 for (i = 1; i < num_dwb_pages; i++)
2928 if (
VPID_EQ (&p_dwb_ordered_slots[i].vpid, &p_dwb_ordered_slots[i - 1].vpid))
2937 if (is_page_corrupted)
2948 if (is_page_corrupted)
2953 if (memcmp (p_dwb_ordered_slots[i - 1].io_page, iopage,
IO_PAGESIZE) == 0)
2959 if (memcmp (p_dwb_ordered_slots[i].io_page, iopage,
IO_PAGESIZE) == 0)
2988 int *p_num_recoverable_pages)
2997 int num_recoverable_pages = 0;
2998 bool is_page_corrupted;
3000 assert (rcv_block != NULL && p_dwb_ordered_slots != NULL && p_num_recoverable_pages != NULL);
3009 vpid = &p_dwb_ordered_slots[
i].
vpid;
3015 if (volid != vpid->
volid)
3023 vol_fd = temp_vol_fd;
3024 volid = vpid->
volid;
3030 if (vpid->
pageid >= vol_pages)
3050 if (!is_page_corrupted)
3065 if (is_page_corrupted)
3075 num_recoverable_pages++;
3078 *p_num_recoverable_pages = num_recoverable_pages;
3098 unsigned int num_dwb_pages, ordered_slots_length,
i;
3102 int num_recoverable_pages;
3120 dwb_log (
"dwb_load_and_recover_pages: The number of pages in DWB %d\n", num_dwb_pages);
3147 for (i = 0; i < num_dwb_pages; i++)
3172 s1 = &p_dwb_ordered_slots[
i];
3173 s2 = &p_dwb_ordered_slots[i + 1];
3180 dwb_log (
"dwb_load_and_recover_pages: Found duplicates in DWB at positions = (%d,%d) %d\n",
3187 dwb_log (
"dwb_load_and_recover_pages: Invalidated the page at position = (%d)\n",
3201 dwb_log (
"dwb_load_and_recover_pages: Invalidated the page at position = (%d)\n",
3208 dwb_log (
"dwb_load_and_recover_pages: Invalidated the page at position = (%d)\n",
3215 #if !defined (NDEBUG) 3231 if (0 < num_recoverable_pages)
3235 dwb_write_block (thread_p, rcv_block, p_dwb_ordered_slots, ordered_slots_length,
false,
false);
3251 dwb_log (
"dwb_load_and_recover_pages: Synchronized volume %d\n",
3270 error_code =
dwb_create (thread_p, dwb_path_p, db_name_p);
3278 if (p_dwb_ordered_slots != NULL)
3283 if (rcv_block != NULL)
3302 UINT64 current_position_with_flags;
3324 #if defined(SERVER_MODE) 3325 dwb_daemons_destroy ();
3357 unsigned int block_no;
3360 UINT64 position_with_flags;
3372 flush_block = &dwb_Global.
blocks[block_no];
3396 dwb_log (
"Successfully flushed DWB block = %d having version %lld\n",
3416 UINT64 initial_position_with_flags, current_position_with_flags, prev_position_with_flags;
3417 UINT64 initial_block_version, current_block_version;
3424 unsigned int count_added_pages = 0, max_pages_to_add = 0, initial_num_pages = 0;
3426 PERF_UTIME_TRACKER time_track;
3429 assert (all_sync != NULL);
3431 PERF_UTIME_TRACKER_START (thread_p, &time_track);
3437 dwb_log (
"dwb_flush_force: Started with initital position = %lld\n", initial_position_with_flags);
3439 #if !defined (NDEBUG) 3440 if (dwb_Global.
blocks != NULL)
3444 dwb_log_error (
"dwb_flush_force start: Block %d, Num pages = %d, version = %lld\n",
3456 dwb_log (
"dwb_flush_force: Everything flushed\n");
3471 dwb_log_error (
"dwb_flush_force : Error %d while waiting for structure modification=%lld\n",
3483 if (initial_block == NULL)
3489 goto wait_for_file_sync_helper_block;
3493 initial_block_no = -1;
3494 initial_block_version = 0;
3498 && (dwb_Global.
blocks[block_no].
version >= initial_block_version))
3500 initial_block_no = block_no;
3501 initial_block_version = dwb_Global.
blocks[initial_block_no].
version;
3506 assert (initial_block_no != -1);
3514 prev_position_with_flags = initial_position_with_flags;
3522 dwb_log (
"dwb_flush_force: Waits for flushing the block %d having version %lld and %d pages\n",
3523 initial_block_no, initial_block_version, initial_num_pages);
3526 check_flushed_blocks:
3528 assert (initial_block_no >= 0);
3530 && (ATOMIC_INC_32 (&dwb_Global.
next_block_to_flush, 0) == (
unsigned int) initial_block_no)
3540 goto check_flushed_blocks;
3543 dwb_log_error (
"dwb_flush_force : Error %d while waiting for block completion = %lld\n",
3548 goto check_flushed_blocks;
3559 dwb_log (
"dwb_flush_force: Everything flushed\n");
3572 goto check_flushed_blocks;
3575 dwb_log_error (
"dwb_flush_force : Error %d while waiting for structure modification = %lld\n",
3585 goto wait_for_file_sync_helper_block;
3590 current_block_version = dwb_Global.
blocks[current_block_no].
version;
3592 if ((current_block_no == initial_block_no) && (current_block_version != initial_block_version))
3594 assert (current_block_version > initial_block_version);
3597 goto wait_for_file_sync_helper_block;
3600 if (current_position_with_flags == prev_position_with_flags && count_added_pages < max_pages_to_add)
3605 error_code =
dwb_add_page (thread_p, iopage, &null_vpid, &dwb_slot);
3608 dwb_log_error (
"dwb_flush_force : Error %d while adding page = %lld\n",
3612 else if (dwb_slot == NULL)
3621 count_added_pages++;
3624 prev_position_with_flags = current_position_with_flags;
3625 goto check_flushed_blocks;
3627 wait_for_file_sync_helper_block:
3629 initial_block = &dwb_Global.
blocks[initial_block_no];
3631 #if defined (SERVER_MODE) 3645 #if !defined (NDEBUG) 3646 if (dwb_Global.
blocks != NULL)
3650 dwb_log_error (
"dwb_flush_force end: Block %d, Num pages = %d, version = %lld\n",
3669 int num_pages, num_pages2, num_pages_to_sync;
3671 UINT64 position_with_flags;
3673 unsigned int count_flush_volumes_info = 0;
3674 bool all_block_pages_written =
false, need_wait =
false, can_flush_volume =
false;
3675 unsigned int start_flush_volume = 0;
3676 int first_partial_flushed_volume = -1;
3677 PERF_UTIME_TRACKER time_track;
3679 PERF_UTIME_TRACKER_START (thread_p, &time_track);
3700 first_partial_flushed_volume = -1;
3702 for (i = start_flush_volume; i < count_flush_volumes_info; i++)
3720 num_pages = ATOMIC_INC_32 (¤t_flush_volume_info->
num_pages, 0);
3721 if (num_pages < num_pages_to_sync)
3736 assert (all_block_pages_written ==
false);
3738 if (first_partial_flushed_volume == -1)
3740 first_partial_flushed_volume =
i;
3749 if (first_partial_flushed_volume == -1)
3751 first_partial_flushed_volume =
i;
3756 num_pages2 = ATOMIC_TAS_32 (¤t_flush_volume_info->
num_pages, 0);
3765 dwb_log (
"dwb_file_sync_helper: Synchronized volume %d\n", current_flush_volume_info->
vdes);
3769 if (first_partial_flushed_volume != -1)
3771 assert ((first_partial_flushed_volume >= 0)
3772 && ((
unsigned int) first_partial_flushed_volume < count_flush_volumes_info));
3775 start_flush_volume = first_partial_flushed_volume;
3780 start_flush_volume = count_flush_volumes_info;
3783 can_flush_volume =
false;
3787 can_flush_volume =
true;
3789 else if (all_block_pages_written ==
false)
3792 if (first_partial_flushed_volume != -1)
3794 current_flush_volume_info = &block->
flush_volumes_info[first_partial_flushed_volume];
3796 if ((ATOMIC_INC_32 (¤t_flush_volume_info->
num_pages, 0) < num_pages_to_sync)
3805 can_flush_volume =
true;
3815 can_flush_volume =
true;
3819 if (!can_flush_volume)
3822 if (need_wait ==
true)
3825 #if defined (SERVER_MODE) 3829 can_flush_volume =
true;
3833 while (can_flush_volume ==
true);
3835 #if !defined (NDEBUG) 3836 if (count_flush_volumes_info != 0)
3840 for (i = 0; i < count_flush_volumes_info; i++)
3874 assert (vpid != NULL && io_page != NULL && success != NULL);
3883 VPID key_vpid = *vpid;
3885 if (slots_hash_entry != NULL)
3908 #if defined(SERVER_MODE) 3917 PERF_UTIME_TRACKER m_perf_track;
3920 dwb_flush_block_daemon_task ()
3922 PERF_UTIME_TRACKER_START (NULL, &m_perf_track);
3945 PERF_UTIME_TRACKER_START (&thread_ref, &m_perf_track);
3974 dwb_flush_block_daemon_init ()
3977 dwb_flush_block_daemon_task *daemon_task =
new dwb_flush_block_daemon_task ();
3986 dwb_file_sync_helper_daemon_init ()
4000 dwb_flush_block_daemon_init ();
4001 dwb_file_sync_helper_daemon_init ();
4008 dwb_daemons_destroy ()
4023 #if defined (SERVER_MODE) 4037 #if defined (SERVER_MODE) 4052 #if defined (SERVER_MODE) 4054 && (dwb_flush_block_daemon->is_running ()));
4068 #if defined (SERVER_MODE) 4070 && (dwb_file_sync_helper_daemon->
is_running ()));
#define DWB_NUM_TOTAL_BLOCKS
#define DWB_IS_ANY_BLOCK_WRITE_STARTED(position_with_flags)
bool logpb_need_wal(const LOG_LSA *lsa)
cubthread::entry * thread_get_thread_entry_info(void)
STATIC_INLINE int dwb_slots_hash_delete(THREAD_ENTRY *thread_p, DWB_SLOT *slot)
#define BO_IS_SERVER_RESTARTED()
STATIC_INLINE void dwb_destroy_wait_queue(DWB_WAIT_QUEUE *wait_queue, pthread_mutex_t *mutex)
dwb_hashmap_type slots_hashmap
STATIC_INLINE int dwb_set_status_resumed(void *data) __attribute__((ALWAYS_INLINE))
#define ER_CSS_PTHREAD_COND_TIMEDOUT
bool LSA_EQ(const log_lsa *plsa1, const log_lsa *plsa2)
int dwb_recreate(THREAD_ENTRY *thread_p)
void LSA_COPY(log_lsa *plsa1, const log_lsa *plsa2)
static int dwb_debug_check_dwb(THREAD_ENTRY *thread_p, DWB_SLOT *p_dwb_ordered_slots, unsigned int num_pages)
static int dwb_slots_hash_key_copy(void *src, void *dest)
#define VPID_COPY(dest_ptr, src_ptr)
void * fileio_read(THREAD_ENTRY *thread_p, int vol_fd, void *io_page_p, PAGEID page_id, size_t page_size)
volatile FLUSH_VOLUME_STATUS flushed_status
#define DWB_ENDS_BLOCK_WRITING(position_with_flags, block_no)
static int write_buffer(SOCKET sock_fd, const char *buf, int size)
int dwb_load_and_recover_pages(THREAD_ENTRY *thread_p, const char *dwb_path_p, const char *db_name_p)
bool dwb_is_created(void)
void fileio_unformat(THREAD_ENTRY *thread_p, const char *vol_label_p)
#define DWB_ENDS_MODIFYING_STRUCTURE(position_with_flags)
STATIC_INLINE int dwb_create_internal(THREAD_ENTRY *thread_p, const char *dwb_volume_name, UINT64 *current_position_with_flags) __attribute__((ALWAYS_INLINE))
#define ASSERT_ERROR_AND_SET(error_code)
static void * dwb_slots_hash_entry_alloc(void)
void thread_sleep(double millisec)
STATIC_INLINE int dwb_slots_hash_insert(THREAD_ENTRY *thread_p, VPID *vpid, DWB_SLOT *slot, bool *inserted) __attribute__((ALWAYS_INLINE))
#define assert_release(e)
void thread_wakeup_already_had_mutex(cubthread::entry *thread_p, thread_resume_suspend_status resume_reason)
STATIC_INLINE DWB_WAIT_QUEUE_ENTRY * dwb_make_wait_queue_entry(DWB_WAIT_QUEUE *wait_queue, void *data) __attribute__((ALWAYS_INLINE))
static bool dwb_flush_block_daemon_is_running(void)
static int dwb_compare_vol_fd(const void *v1, const void *v2)
STATIC_INLINE void dwb_initialize_slot(DWB_SLOT *slot, FILEIO_PAGE *io_page, unsigned int position_in_block, unsigned int block_no) __attribute__((ALWAYS_INLINE))
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) __attribute__((ALWAYS_INLINE))
bool fileio_is_volume_exist(const char *vol_label_p)
int dwb_create(THREAD_ENTRY *thread_p, const char *dwb_path_p, const char *db_name_p)
DWB_SLOTS_HASH_ENTRY * next
int dwb_read_page(THREAD_ENTRY *thread_p, const VPID *vpid, void *io_page, bool *success)
#define PTR_ALIGN(addr, boundary)
bool LSA_LT(const log_lsa *plsa1, const log_lsa *plsa2)
unsigned int log2_num_block_pages
STATIC_INLINE void dwb_init_wait_queue(DWB_WAIT_QUEUE *wait_queue) __attribute__((ALWAYS_INLINE))
int fileio_mount(THREAD_ENTRY *thread_p, const char *db_full_name_p, const char *vol_label_p, VOLID vol_id, int lock_wait, bool is_do_sync)
void * fileio_read_pages(THREAD_ENTRY *thread_p, int vol_fd, char *io_pages_p, PAGEID page_id, int num_pages, size_t page_size)
bool find_or_insert(cubthread::entry *thread_p, Key &key, T *&t)
STATIC_INLINE void dwb_init_slot(DWB_SLOT *slot) __attribute__((ALWAYS_INLINE))
DWB_WAIT_QUEUE_ENTRY * free_list
volatile unsigned int next_block_to_flush
STATIC_INLINE void dwb_signal_block_completion(THREAD_ENTRY *thread_p, DWB_BLOCK *dwb_block) __attribute__((ALWAYS_INLINE))
STATIC_INLINE int dwb_signal_waiting_thread(void *data) __attribute__((ALWAYS_INLINE))
unsigned int num_block_pages
manager * get_manager(void)
const char * boot_db_full_name()
UINT64 volatile position_with_flags
static int dwb_slots_hash_compare_key(void *key1, void *key2)
#define VPID_SET(vpid_ptr, volid_value, pageid_value)
void er_set(int severity, const char *file_name, const int line_no, int err_id, int num_args,...)
FLUSH_VOLUME_INFO * flush_volumes_info
char dwb_Volume_name[PATH_MAX]
static LF_ENTRY_DESCRIPTOR slots_entry_Descriptor
static bool dwb_is_file_sync_helper_daemon_available(void)
#define DWB_STARTS_CREATION(position_with_flags)
static int dwb_check_data_page_is_sane(THREAD_ENTRY *thread_p, DWB_BLOCK *rcv_block, DWB_SLOT *p_dwb_ordered_slots, int *p_num_recoverable_pages)
#define DWB_IS_MODIFYING_STRUCTURE(position_with_flags)
DWB_WAIT_QUEUE_ENTRY * head
int prm_get_integer_value(PARAM_ID prm_id)
T * find(cubthread::entry *thread_p, Key &key)
#define pthread_mutex_destroy(a)
STATIC_INLINE void dwb_remove_wait_queue_entry(DWB_WAIT_QUEUE *wait_queue, pthread_mutex_t *mutex, void *data, int(*func)(void *)) __attribute__((ALWAYS_INLINE))
bool erase_locked(cubthread::entry *thread_p, Key &key, T *&t)
#define ER_OUT_OF_VIRTUAL_MEMORY
#define DWB_GET_PREV_BLOCK(block_no)
#define DWB_STARTS_BLOCK_WRITING(position_with_flags, block_no)
STATIC_INLINE DWB_WAIT_QUEUE_ENTRY * dwb_block_disconnect_wait_queue_entry(DWB_WAIT_QUEUE *wait_queue, void *data) __attribute__((ALWAYS_INLINE))
#define DWB_SLOTS_FREE_LIST_SIZE
STATIC_INLINE int dwb_block_create_ordered_slots(DWB_BLOCK *block, DWB_SLOT **p_dwb_ordered_slots, unsigned int *p_ordered_slots_length) __attribute__((ALWAYS_INLINE))
bool LSA_LE(const log_lsa *plsa1, const log_lsa *plsa2)
LF_TRAN_SYSTEM dwb_slots_Ts
char * dwb_get_volume_name(void)
#define VPID_EQ(vpid_ptr1, vpid_ptr2)
volatile bool all_pages_written
#define DWB_STARTS_MODIFYING_STRUCTURE(position_with_flags)
STATIC_INLINE void dwb_signal_waiting_threads(DWB_WAIT_QUEUE *wait_queue, pthread_mutex_t *mutex) __attribute__((ALWAYS_INLINE))
DWB_WAIT_QUEUE_ENTRY * next
void fileio_dismount(THREAD_ENTRY *thread_p, int vol_fd)
#define DWB_RESET_POSITION(position_with_flags)
int fileio_synchronize_all(THREAD_ENTRY *thread_p, bool is_include)
static int dwb_flush_next_block(THREAD_ENTRY *thread_p)
STATIC_INLINE void dwb_destroy_internal(THREAD_ENTRY *thread_p, UINT64 *current_position_with_flags) __attribute__((ALWAYS_INLINE))
STATIC_INLINE void dwb_ends_structure_modification(THREAD_ENTRY *thread_p, UINT64 current_position_with_flags) __attribute__((ALWAYS_INLINE))
STATIC_INLINE bool perfmon_is_perf_tracking_and_active(int activation_flag) __attribute__((ALWAYS_INLINE))
#define DWB_GET_BLOCK_NO_FROM_POSITION(position_with_flags)
bool LSA_ISNULL(const log_lsa *lsa_ptr)
void init(lf_tran_system &transys, int entry_idx, int hash_size, int freelist_block_size, int freelist_block_count, lf_entry_descriptor &edesc)
#define pthread_mutex_init(a, b)
STATIC_INLINE void dwb_finalize_block(DWB_BLOCK *block) __attribute__((ALWAYS_INLINE))
static DOUBLE_WRITE_BUFFER dwb_Global
STATIC_INLINE void dwb_signal_structure_modificated(THREAD_ENTRY *thread_p) __attribute__((ALWAYS_INLINE))
void thread_lock_entry(cubthread::entry *thread_p)
#define DWB_NOT_CREATED_OR_MODIFYING(position_with_flags)
volatile bool all_pages_written
#define DWB_BLOCK_NUM_PAGES
bool logtb_set_check_interrupt(THREAD_ENTRY *thread_p, bool flag)
const VOLID LOG_DBDWB_VOLID
#define DWB_GET_BLOCK_STATUS(position_with_flags)
int timeval_to_timespec(struct timespec *to, const struct timeval *from)
int dwb_set_data_on_next_slot(THREAD_ENTRY *thread_p, FILEIO_PAGE *io_page_p, bool can_wait, DWB_SLOT **p_dwb_slot)
static int dwb_file_sync_helper(THREAD_ENTRY *thread_p)
STATIC_INLINE int dwb_wait_for_strucure_modification(THREAD_ENTRY *thread_p) __attribute__((ALWAYS_INLINE))
DWB_WAIT_QUEUE_ENTRY * tail
#define DWB_IS_CREATED(position_with_flags)
STATIC_INLINE int dwb_wait_for_block_completion(THREAD_ENTRY *thread_p, unsigned int block_no) __attribute__((ALWAYS_INLINE))
static DB_VALUE * new_block(long n)
#define VPID_ISNULL(vpid_ptr)
void thread_unlock_entry(cubthread::entry *thread_p)
void * fileio_write(THREAD_ENTRY *thread_p, int vol_fd, void *io_page_p, PAGEID page_id, size_t page_size, FILEIO_WRITE_MODE write_mode)
DWB_SLOTS_HASH_ENTRY * stack
void destroy_daemon(daemon *&daemon_arg)
STATIC_INLINE FLUSH_VOLUME_INFO * dwb_add_volume_to_block_flush_area(THREAD_ENTRY *thread_p, DWB_BLOCK *block, int vol_fd) __attribute__((ALWAYS_INLINE))
#define DWB_WAIT_QUEUE_INITIALIZER
#define DWB_SLOTS_HASH_SIZE
STATIC_INLINE int dwb_acquire_next_slot(THREAD_ENTRY *thread_p, bool can_wait, DWB_SLOT **p_dwb_slot) __attribute__((ALWAYS_INLINE))
int fileio_synchronize(THREAD_ENTRY *thread_p, int vol_fd, const char *vlabel, FILEIO_SYNC_OPTION sync_dwb)
DKNPAGES fileio_get_number_of_volume_pages(int vol_fd, size_t page_size)
#define dwb_check_logging()
#define free_and_init(ptr)
#define DWB_IS_BLOCK_WRITE_STARTED(position_with_flags, block_no)
#define pthread_mutex_lock(a)
void LSA_SET_NULL(log_lsa *lsa_ptr)
STATIC_INLINE void dwb_block_free_wait_queue_entry(DWB_WAIT_QUEUE *wait_queue, DWB_WAIT_QUEUE_ENTRY *wait_queue_entry, int(*func)(void *)) __attribute__((ALWAYS_INLINE))
STATIC_INLINE void dwb_adjust_write_buffer_values(unsigned int *p_double_write_buffer_size, unsigned int *p_num_blocks) __attribute__((ALWAYS_INLINE))
void fileio_make_dwb_name(char *dwb_name_p, const char *dwb_path_p, const char *db_name_p)
volatile unsigned int blocks_flush_counter
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) __attribute__((ALWAYS_INLINE))
volatile unsigned int count_flush_volumes_info
bool prm_get_bool_value(PARAM_ID prm_id)
int thread_suspend_timeout_wakeup_and_unlock_entry(cubthread::entry *thread_p, struct timespec *time_p, thread_resume_suspend_status suspended_reason)
int fileio_format(THREAD_ENTRY *thread_p, const char *db_full_name_p, const char *vol_label_p, VOLID vol_id, DKNPAGES npages, bool is_sweep_clean, bool is_do_lock, bool is_do_sync, size_t page_size, int kbytes_to_be_written_per_sec, bool reuse_file)
STATIC_INLINE void dwb_get_next_block_for_flush(THREAD_ENTRY *thread_p, unsigned int *block_no) __attribute__((ALWAYS_INLINE))
static int dwb_slots_hash_entry_init(void *entry)
unsigned int position_in_block
int dwb_flush_force(THREAD_ENTRY *thread_p, bool *all_sync)
static bool dwb_file_sync_helper_daemon_is_running(void)
volatile unsigned int count_wb_pages
static unsigned int dwb_slots_hash_key(void *key, int hash_table_size)
void * fileio_write_pages(THREAD_ENTRY *thread_p, int vol_fd, char *io_pages_p, PAGEID page_id, int num_pages, size_t page_size, FILEIO_WRITE_MODE write_mode)
void fileio_initialize_res(THREAD_ENTRY *thread_p, FILEIO_PAGE *io_page, PGLENGTH page_size)
STATIC_INLINE void perfmon_add_stat(THREAD_ENTRY *thread_p, PERF_STAT_ID psid, UINT64 amount) __attribute__((ALWAYS_INLINE))
LOG_LSA get_nxio_lsa() const
STATIC_INLINE int fileio_is_page_sane(FILEIO_PAGE *io_page, PGLENGTH page_size)
STATIC_INLINE int dwb_create_blocks(THREAD_ENTRY *thread_p, unsigned int num_blocks, unsigned int num_block_pages, DWB_BLOCK **p_blocks) __attribute__((ALWAYS_INLINE))
int dwb_destroy(THREAD_ENTRY *thread_p)
#define DWB_ENDS_CREATION(position_with_flags)
unsigned int max_to_flush_vdes
STATIC_INLINE void dwb_set_slot_data(THREAD_ENTRY *thread_p, DWB_SLOT *dwb_slot, FILEIO_PAGE *io_page_p) __attribute__((ALWAYS_INLINE))
#define DWB_GET_PREV_BLOCK_NO(block_no)
DWB_WAIT_QUEUE wait_queue
STATIC_INLINE int dwb_starts_structure_modification(THREAD_ENTRY *thread_p, UINT64 *current_position_with_flags) __attribute__((ALWAYS_INLINE))
static int dwb_compare_slots(const void *arg1, const void *arg2)
DWB_BLOCK *volatile file_sync_helper_block
STATIC_INLINE DWB_WAIT_QUEUE_ENTRY * dwb_block_add_wait_queue_entry(DWB_WAIT_QUEUE *wait_queue, void *data) __attribute__((ALWAYS_INLINE))
struct double_write_slot DWB_SLOT
daemon * create_daemon(const looper &looper_arg, entry_task *exec_p, const char *daemon_name="", entry_manager *context_manager=NULL)
#define pthread_mutex_unlock(a)
int dwb_add_page(THREAD_ENTRY *thread_p, FILEIO_PAGE *io_page_p, VPID *vpid, DWB_SLOT **p_dwb_slot)
#define DWB_GET_NEXT_BLOCK_NO(block_no)
#define VPID_LT(vpid_ptr1, vpid_ptr2)
#define dwb_log_error(...)
DWB_WAIT_QUEUE wait_queue
int timeval_add_msec(struct timeval *added_time, const struct timeval *start_time, int msec)
callable_task< entry > entry_callable_task
#define VPID_SET_NULL(vpid_ptr)
STATIC_INLINE int dwb_flush_block(THREAD_ENTRY *thread_p, DWB_BLOCK *block, bool file_sync_helper_can_flush, UINT64 *current_position_with_flags) __attribute__((ALWAYS_INLINE))
#define DWB_GET_POSITION_IN_BLOCK(position_with_flags)
#define LF_EM_USING_MUTEX
int fileio_page_check_corruption(THREAD_ENTRY *thread_p, FILEIO_PAGE *io_page, bool *is_page_corrupted)
#define DWB_GET_NEXT_POSITION_WITH_FLAGS(position_with_flags)
static bool dwb_is_flush_block_daemon_available(void)
int fileio_get_volume_descriptor(VOLID vol_id)
static int dwb_slots_hash_entry_free(void *entry)