42 #ifndef UNIV_HOTBACKUP
55 #include <drizzled/errmsg_print.h>
245 #ifndef UNIV_HOTBACKUP
247 static const int WAIT_FOR_READ = 5000;
249 static const ulint BUF_PAGE_READ_MAX_RETRIES = 100;
254 #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
255 static ulint buf_dbg_counter = 0;
262 UNIV_INTERN ibool buf_debug_prints = FALSE;
265 #ifdef UNIV_PFS_RWLOCK
268 UNIV_INTERN mysql_pfs_key_t buf_block_lock_key;
269 # ifdef UNIV_SYNC_DEBUG
270 UNIV_INTERN mysql_pfs_key_t buf_block_debug_latch_key;
274 #ifdef UNIV_PFS_MUTEX
275 UNIV_INTERN mysql_pfs_key_t buffer_block_mutex_key;
276 UNIV_INTERN mysql_pfs_key_t buf_pool_mutex_key;
277 UNIV_INTERN mysql_pfs_key_t buf_pool_zip_mutex_key;
278 UNIV_INTERN mysql_pfs_key_t flush_list_mutex_key;
281 #if defined UNIV_PFS_MUTEX || defined UNIV_PFS_RWLOCK
282 # ifndef PFS_SKIP_BUFFER_MUTEX_RWLOCK
288 # define PFS_GROUP_BUFFER_SYNC
294 # define PFS_MAX_BUFFER_MUTEX_LOCK_REGISTER ULINT_MAX
321 ib_uint64_t oldest_lsn = 0;
338 ut_ad(bpage->in_flush_list);
344 if (!oldest_lsn || oldest_lsn > lsn) {
365 ulint* flush_list_len)
393 memset(tot_stat, 0,
sizeof(*tot_stat));
401 buf_stat = &buf_pool->
stat;
430 if (buf_pool == NULL) {
470 checksum = checksum & 0xFFFFFFFFUL;
493 checksum = checksum & 0xFFFFFFFFUL;
505 const byte* read_buf,
509 ulint checksum_field;
510 ulint old_checksum_field;
512 if (UNIV_LIKELY(!zip_size)
514 read_buf + UNIV_PAGE_SIZE
523 #ifndef UNIV_HOTBACKUP
525 ib_uint64_t current_lsn;
533 drizzled::errmsg_printf(drizzled::error::INFO,
534 "InnoDB: Error: page %lu log sequence number %"PRIu64
". "
535 "InnoDB: is in the future! Current system log sequence number %"PRIu64
". "
536 "Your database may be corrupt or you may have copied the InnoDB tablespace but not the InnoDB log files. See "
537 " " REFMAN
"forcing-innodb-recovery.html for more information. ",
551 if (UNIV_LIKELY(srv_use_checksums)) {
555 if (UNIV_UNLIKELY(zip_size)) {
562 read_buf + UNIV_PAGE_SIZE
576 && old_checksum_field
585 if (checksum_field != 0
603 const byte* read_buf,
607 #ifndef UNIV_HOTBACKUP
612 ulint size = zip_size;
615 size = UNIV_PAGE_SIZE;
619 fprintf(stderr,
" InnoDB: Page dump in ascii and hex (%lu bytes):\n",
622 fputs(
"\nInnoDB: End of page dump\n", stderr);
630 checksum = srv_use_checksums
635 " InnoDB: Compressed BLOB page"
636 " checksum %lu, stored %lu\n"
637 "InnoDB: Page lsn %lu %lu\n"
638 "InnoDB: Page number (if stored"
639 " to page already) %lu,\n"
640 "InnoDB: space id (if stored"
641 " to page already) %lu\n",
658 " InnoDB: unknown page type %lu,"
659 " assuming FIL_PAGE_INDEX\n",
663 checksum = srv_use_checksums
669 " InnoDB: Compressed page checksum %lu,"
671 "InnoDB: Page lsn %lu %lu\n"
672 "InnoDB: Page number (if stored"
673 " to page already) %lu,\n"
674 "InnoDB: space id (if stored"
675 " to page already) %lu\n",
695 checksum = srv_use_checksums
697 old_checksum = srv_use_checksums
702 " InnoDB: Page checksum %lu, prior-to-4.0.14-form"
704 "InnoDB: stored checksum %lu, prior-to-4.0.14-form"
705 " stored checksum %lu\n"
706 "InnoDB: Page lsn %lu %lu, low 4 bytes of lsn"
708 "InnoDB: Page number (if stored to page already) %lu,\n"
709 "InnoDB: space id (if created with >= MySQL-4.1.1"
710 " and stored already) %lu\n",
711 (ulong) checksum, (ulong) old_checksum,
723 #ifndef UNIV_HOTBACKUP
725 == TRX_UNDO_INSERT) {
727 "InnoDB: Page may be an insert undo log page\n");
730 == TRX_UNDO_UPDATE) {
732 "InnoDB: Page may be an update undo log page\n");
741 "InnoDB: Page may be an index page where"
742 " index id is %llu\n",
744 #ifndef UNIV_HOTBACKUP
747 fputs(
"InnoDB: (", stderr);
749 fputs(
")\n", stderr);
754 fputs(
"InnoDB: Page may be an 'inode' page\n", stderr);
757 fputs(
"InnoDB: Page may be an insert buffer free list page\n",
761 fputs(
"InnoDB: Page may be a freshly allocated page\n",
765 fputs(
"InnoDB: Page may be an insert buffer bitmap page\n",
769 fputs(
"InnoDB: Page may be a system page\n",
773 fputs(
"InnoDB: Page may be a transaction system page\n",
777 fputs(
"InnoDB: Page may be a file space header page\n",
781 fputs(
"InnoDB: Page may be an extent descriptor page\n",
785 fputs(
"InnoDB: Page may be a BLOB page\n",
790 fputs(
"InnoDB: Page may be a compressed BLOB page\n",
796 #ifndef UNIV_HOTBACKUP
798 # ifdef PFS_GROUP_BUFFER_SYNC
807 pfs_register_buffer_block(
812 ulint num_to_register;
818 PFS_MAX_BUFFER_MUTEX_LOCK_REGISTER);
820 for (i = 0; i < num_to_register; i++) {
824 # ifdef UNIV_PFS_MUTEX
825 mutex = &block->
mutex;
826 ut_a(!mutex->pfs_psi);
827 mutex->pfs_psi = (PSI_server)
828 ? PSI_server->init_mutex(buffer_block_mutex_key, mutex)
832 # ifdef UNIV_PFS_RWLOCK
833 rwlock = &block->
lock;
834 ut_a(!rwlock->pfs_psi);
835 rwlock->pfs_psi = (PSI_server)
836 ? PSI_server->init_rwlock(buf_block_lock_key, rwlock)
854 UNIV_MEM_DESC(frame, UNIV_PAGE_SIZE, block);
856 block->
frame = frame;
865 #if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG
866 block->
page.file_page_was_freed = FALSE;
875 block->
page.in_page_hash = FALSE;
876 block->
page.in_zip_hash = FALSE;
877 block->
page.in_flush_list = FALSE;
878 block->
page.in_free_list = FALSE;
879 block->
page.in_LRU_list = FALSE;
880 block->in_unzip_LRU_list = FALSE;
882 #if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
883 block->n_pointers = 0;
887 #if defined PFS_SKIP_BUFFER_MUTEX_RWLOCK || defined PFS_GROUP_BUFFER_SYNC
894 mutex_create(PFS_NOT_INSTRUMENTED, &block->
mutex, SYNC_BUF_BLOCK);
897 mutex_create(buffer_block_mutex_key, &block->
mutex, SYNC_BUF_BLOCK);
903 #ifdef UNIV_SYNC_DEBUG
905 &block->debug_latch, SYNC_NO_ORDER_CHECK);
928 mem_size +=
ut_2pow_round((mem_size / UNIV_PAGE_SIZE) * (
sizeof *block)
929 + (UNIV_PAGE_SIZE - 1), UNIV_PAGE_SIZE);
934 if (UNIV_UNLIKELY(chunk->
mem == NULL)) {
948 frame =
static_cast<unsigned char *
>(
ut_align(chunk->
mem, UNIV_PAGE_SIZE));
950 - (frame != chunk->
mem);
954 ulint size = chunk->
size;
956 while (frame < (byte*) (chunk->
blocks + size)) {
957 frame += UNIV_PAGE_SIZE;
970 for (i = chunk->
size; i--; ) {
972 buf_block_init(buf_pool, block, frame);
976 memset(block->
frame,
'\0', UNIV_PAGE_SIZE);
981 ut_d(block->
page.in_free_list = TRUE);
985 frame += UNIV_PAGE_SIZE;
988 #ifdef PFS_GROUP_BUFFER_SYNC
989 pfs_register_buffer_block(chunk);
1001 buf_chunk_contains_zip(
1011 for (i = chunk->
size; i--; block++) {
1027 buf_pool_contains_zip(
1037 for (n = buf_pool->
n_chunks; n--; chunk++) {
1039 buf_block_t* block = buf_chunk_contains_zip(chunk, data);
1055 buf_chunk_not_freed(
1064 for (i = chunk->
size; i--; block++) {
1083 mutex_enter(&block->
mutex);
1085 mutex_exit(&block->
mutex);
1113 for (i = chunk->
size; i--; block++) {
1140 for (block = chunk->
blocks; block < block_end; block++) {
1145 ut_ad(!block->in_unzip_LRU_list);
1152 mutex_free(&block->
mutex);
1153 rw_lock_free(&block->
lock);
1154 #ifdef UNIV_SYNC_DEBUG
1155 rw_lock_free(&block->debug_latch);
1157 UNIV_MEM_UNDESC(block);
1167 buf_pool_set_sizes(
void)
1171 ulint curr_size = 0;
1193 buf_pool_init_instance(
1196 ulint buf_pool_size,
1204 mutex_create(buf_pool_mutex_key,
1205 &buf_pool->
mutex, SYNC_BUF_POOL);
1206 mutex_create(buf_pool_zip_mutex_key,
1211 if (buf_pool_size > 0) {
1213 void *chunk_ptr=
mem_zalloc((
sizeof *chunk));
1218 if (!buf_chunk_init(buf_pool, chunk, buf_pool_size)) {
1241 SYNC_BUF_FLUSH_LIST);
1261 buf_pool_free_instance(
1269 chunks = buf_pool->
chunks;
1270 chunk = chunks + buf_pool->
n_chunks;
1272 while (--chunk >= chunks) {
1294 const ulint size = total_size / n_instances;
1296 ut_ad(n_instances > 0);
1306 for (i = 0; i < n_instances; i++) {
1309 if (buf_pool_init_instance(ptr, size, i) != DB_SUCCESS) {
1318 buf_pool_set_sizes();
1337 for (i = 0; i < n_instances; i++) {
1349 buf_pool_drop_hash_index_instance(
1352 ibool* released_search_latch)
1359 while (--chunk >= chunks) {
1363 for (i = chunk->
size; i--; block++) {
1379 *released_search_latch = TRUE;
1381 rw_lock_x_lock(&block->
lock);
1408 rw_lock_x_unlock(&block->
lock);
1426 ibool released_search_latch;
1428 #ifdef UNIV_SYNC_DEBUG
1436 released_search_latch = FALSE;
1443 buf_pool_drop_hash_index_instance(
1444 buf_pool, &released_search_latch);
1447 }
while (released_search_latch);
1471 ut_ad(bpage->in_LRU_list);
1472 ut_ad(!bpage->in_zip_hash);
1473 ut_ad(bpage->in_page_hash);
1492 memcpy(dpage, bpage,
sizeof *dpage);
1494 ut_d(bpage->in_LRU_list = FALSE);
1495 ut_d(bpage->in_page_hash = FALSE);
1507 if (UNIV_UNLIKELY(buf_pool->
LRU_old == bpage)) {
1509 #ifdef UNIV_LRU_DEBUG
1525 ut_ad(ut_list_node_313->in_LRU_list)));
1538 buf_pool_shrink_instance(
1546 ulint max_free_size;
1565 chunks = buf_pool->
chunks;
1566 chunk = chunks + buf_pool->
n_chunks;
1567 max_size = max_free_size = 0;
1568 max_chunk = max_free_chunk = NULL;
1570 while (--chunk >= chunks) {
1571 if (chunk->
size <= chunk_size
1572 && chunk->
size > max_free_size) {
1573 if (chunk->
size > max_size) {
1574 max_size = chunk->
size;
1578 if (buf_chunk_all_free(chunk)) {
1579 max_free_size = chunk->
size;
1580 max_free_chunk = chunk;
1585 if (!max_free_size) {
1599 block = max_chunk->
blocks;
1600 bend = block + max_chunk->
size;
1604 for (; block < bend; block++) {
1615 mutex_enter(&block->
mutex);
1630 mutex_exit(&block->
mutex);
1643 == ULINT_UNDEFINED) {
1651 max_size = max_free_size;
1652 max_chunk = max_free_chunk;
1657 chunks =
static_cast<buf_chunk_t *
>(mem_alloc((buf_pool->
n_chunks - 1) *
sizeof *chunks));
1658 memcpy(chunks, buf_pool->
chunks,
1659 (max_chunk - buf_pool->
chunks) *
sizeof *chunks);
1660 memcpy(chunks + (max_chunk - buf_pool->
chunks),
1667 chunk_size -= max_chunk->
size;
1668 buf_chunk_free(buf_pool, max_chunk);
1670 buf_pool->
chunks = chunks;
1674 if (chunk_size > 1048576 / UNIV_PAGE_SIZE) {
1699 ulint instance_chunk_size;
1703 buf_pool_shrink_instance(buf_pool, instance_chunk_size);
1706 buf_pool_set_sizes();
1713 buf_pool_page_hash_rebuild_instance(
1732 BUF_POOL_ZIP_FOLD_BPAGE);
1739 chunk = buf_pool->
chunks;
1742 for (i = 0; i < n_chunks; i++, chunk++) {
1746 for (j = 0; j < chunk->
size; j++, block++) {
1768 ut_ad(!b->in_flush_list);
1769 ut_ad(b->in_LRU_list);
1770 ut_ad(b->in_page_hash);
1771 ut_ad(!b->in_zip_hash);
1780 ut_ad(b->in_flush_list);
1781 ut_ad(b->in_LRU_list);
1782 ut_ad(b->in_page_hash);
1783 ut_ad(!b->in_zip_hash);
1821 if (bpage < &buf_pool->watch[0]
1831 ut_ad(!bpage->in_zip_hash);
1832 ut_ad(bpage->in_page_hash);
1858 if (UNIV_LIKELY_NULL(bpage)) {
1869 bpage = &buf_pool->
watch[i];
1875 ut_ad(!bpage->in_zip_hash);
1877 switch (bpage->
state) {
1879 ut_ad(!bpage->in_page_hash);
1888 bpage->
space = space;
1892 ut_d(bpage->in_page_hash = TRUE);
1897 ut_ad(bpage->in_page_hash);
1919 buf_pool_page_hash_rebuild(
void)
1933 buf_pool_increase_instance(
1942 chunks =
static_cast<buf_chunk_t *
>(mem_alloc((buf_pool->
n_chunks + 1) *
sizeof *chunks));
1944 memcpy(chunks, buf_pool->
chunks, buf_pool->
n_chunks *
sizeof *chunks);
1946 chunk = &chunks[buf_pool->
n_chunks];
1948 if (!buf_chunk_init(buf_pool, chunk, change_size)) {
1955 buf_pool->
chunks = chunks;
1973 buf_pool_increase_instance(
1975 change_size / srv_buf_pool_instances);
1978 buf_pool_set_sizes();
2009 buf_pool_shrink(change_size);
2020 buf_pool_increase(change_size);
2029 buf_pool_page_hash_rebuild();
2039 buf_pool_watch_remove(
2049 ut_d(watch->in_page_hash = FALSE);
2085 buf_pool_watch_remove(buf_pool, fold, bpage);
2149 buf_page_set_accessed_make_young(
2153 unsigned access_time)
2166 }
else if (!access_time) {
2231 #if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG
2240 buf_page_set_file_page_was_freed(
2256 bpage->file_page_was_freed = TRUE;
2272 buf_page_reset_file_page_was_freed(
2286 bpage->file_page_was_freed = FALSE;
2315 unsigned access_time;
2335 #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
2336 ut_a(++buf_dbg_counter % 37 || buf_validate());
2340 if (UNIV_UNLIKELY(!bpage->
zip.
data)) {
2359 mutex_enter(block_mutex);
2364 mutex_enter(block_mutex);
2369 mutex_exit(block_mutex);
2374 __FILE__, __LINE__);
2387 mutex_exit(block_mutex);
2389 buf_page_set_accessed_make_young(bpage, access_time);
2391 #if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG
2392 ut_a(!bpage->file_page_was_freed);
2395 #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
2396 ut_a(++buf_dbg_counter % 5771 || buf_validate());
2408 mutex_enter(block_mutex);
2410 mutex_exit(block_mutex);
2421 #ifdef UNIV_IBUF_COUNT_DEBUG
2437 block->
index = NULL;
2468 if (UNIV_UNLIKELY(stamp_checksum != calc_checksum)) {
2471 " InnoDB: compressed page checksum mismatch"
2472 " (space %u page %u): %lu != %lu\n",
2474 stamp_checksum, calc_checksum);
2482 block->
frame, TRUE)) {
2487 "InnoDB: unable to decompress space %lu page %lu\n",
2500 memcpy(block->
frame, frame,
2507 " InnoDB: unknown compressed page"
2513 #ifndef UNIV_HOTBACKUP
2520 buf_block_align_instance(
2531 for (chunk = buf_pool->
chunks, i = buf_pool->
n_chunks; i--; chunk++) {
2534 if (UNIV_UNLIKELY(ptr < chunk->blocks->frame)) {
2542 offs >>= UNIV_PAGE_SIZE_SHIFT;
2544 if (UNIV_LIKELY(offs < chunk->size)) {
2555 mutex_enter(&block->
mutex);
2595 mutex_exit(&block->
mutex);
2619 block = buf_block_align_instance(
2638 buf_pointer_is_block_field_instance(
2648 while (chunk < echunk) {
2649 if (ptr >= (
void *)chunk->
blocks
2650 && ptr < (
void *)(chunk->
blocks + chunk->
size)) {
2676 found = buf_pointer_is_block_field_instance(
2691 buf_block_is_uncompressed(
2699 if (UNIV_UNLIKELY((((ulint) block) %
sizeof *block) != 0)) {
2704 return(buf_pointer_is_block_field_instance(buf_pool, (
void *)block));
2729 unsigned access_time;
2736 ut_ad(mtr->state == MTR_ACTIVE);
2737 ut_ad((rw_latch == RW_S_LATCH)
2738 || (rw_latch == RW_X_LATCH)
2739 || (rw_latch == RW_NO_LATCH));
2743 ut_ad(rw_latch == RW_NO_LATCH);
2756 #ifndef UNIV_LOG_DEBUG
2759 FALSE, file, line, NULL));
2776 if (!buf_block_is_uncompressed(buf_pool, block)
2781 block = guess = NULL;
2788 if (block == NULL) {
2790 buf_pool, space, offset, fold);
2798 if (block == NULL) {
2803 space, offset, fold);
2805 if (UNIV_LIKELY_NULL(block)) {
2822 }
else if (retries < BUF_PAGE_READ_MAX_RETRIES) {
2825 fprintf(stderr,
"InnoDB: Error: Unable"
2826 " to read tablespace %lu page no"
2827 " %lu into the buffer pool after"
2829 "InnoDB: The most probable cause"
2830 " of this error may be that the"
2831 " table has been corrupted.\n"
2832 "InnoDB: You can try to fix this"
2834 " innodb_force_recovery.\n"
2835 "InnoDB: Please see reference manual"
2836 " for more details.\n"
2837 "InnoDB: Aborting...\n",
2839 BUF_PAGE_READ_MAX_RETRIES);
2844 #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
2845 ut_a(++buf_dbg_counter % 37 || buf_validate());
2875 bpage = &block->
page;
2902 mutex_enter(&block->
mutex);
2908 buf_pool, space, offset, fold);
2910 if (UNIV_UNLIKELY(bpage != hash_bpage)) {
2916 mutex_exit(&block->
mutex);
2933 mutex_exit(&block->
mutex);
2935 goto wait_until_unfixed;
2944 buf_block_init_low(block);
2973 UNIV_MEM_INVALID(bpage,
sizeof *bpage);
2975 mutex_exit(&block->
mutex);
2996 mutex_enter(&block->
mutex);
2999 mutex_exit(&block->
mutex);
3001 rw_lock_x_unlock(&block->
lock);
3016 mutex_enter(&block->
mutex);
3017 #if UNIV_WORD_SIZE == 4
3021 UNIV_MEM_ASSERT_RW(&block->
page,
sizeof block->
page);
3023 #if defined UNIV_DEBUG || defined UNIV_IBUF_DEBUG
3030 mutex_exit(&block->
mutex);
3036 space, offset, fold);
3038 if (UNIV_LIKELY_NULL(block)) {
3048 "innodb_change_buffering_debug evict %u %u\n",
3049 (
unsigned) space, (
unsigned) offset);
3051 }
else if (buf_flush_page_try(buf_pool, block)) {
3053 "innodb_change_buffering_debug flush %u %u\n",
3054 (
unsigned) space, (
unsigned) offset);
3063 buf_block_buf_fix_inc(block, file, line);
3065 mutex_exit(&block->
mutex);
3074 buf_page_set_accessed_make_young(&block->
page, access_time);
3077 #if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG
3078 ut_a(!block->
page.file_page_was_freed);
3081 #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
3082 ut_a(++buf_dbg_counter % 5771 || buf_validate());
3096 mutex_enter(&block->
mutex);
3098 mutex_exit(&block->
mutex);
3109 fix_type = MTR_MEMO_BUF_FIX;
3115 fix_type = MTR_MEMO_PAGE_S_FIX;
3119 ut_ad(rw_latch == RW_X_LATCH);
3122 fix_type = MTR_MEMO_PAGE_X_FIX;
3136 #ifdef UNIV_IBUF_COUNT_DEBUG
3153 ib_uint64_t modify_clock,
3160 unsigned access_time;
3166 ut_ad(mtr->state == MTR_ACTIVE);
3167 ut_ad((rw_latch == RW_S_LATCH) || (rw_latch == RW_X_LATCH));
3169 mutex_enter(&block->
mutex);
3173 mutex_exit(&block->
mutex);
3178 buf_block_buf_fix_inc(block, file, line);
3180 mutex_exit(&block->
mutex);
3188 buf_page_set_accessed_make_young(&block->
page, access_time);
3195 if (rw_latch == RW_S_LATCH) {
3196 success = rw_lock_s_lock_nowait(&(block->
lock),
3198 fix_type = MTR_MEMO_PAGE_S_FIX;
3202 fix_type = MTR_MEMO_PAGE_X_FIX;
3205 if (UNIV_UNLIKELY(!success)) {
3206 mutex_enter(&block->
mutex);
3207 buf_block_buf_fix_dec(block);
3208 mutex_exit(&block->
mutex);
3213 if (UNIV_UNLIKELY(modify_clock != block->
modify_clock)) {
3214 buf_block_dbg_add_level(block, SYNC_NO_ORDER_CHECK);
3216 if (rw_latch == RW_S_LATCH) {
3217 rw_lock_s_unlock(&(block->
lock));
3219 rw_lock_x_unlock(&(block->
lock));
3222 mutex_enter(&block->
mutex);
3223 buf_block_buf_fix_dec(block);
3224 mutex_exit(&block->
mutex);
3231 #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
3232 ut_a(++buf_dbg_counter % 5771 || buf_validate());
3237 #if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG
3238 ut_a(block->
page.file_page_was_freed == FALSE);
3240 if (UNIV_UNLIKELY(!access_time)) {
3250 #ifdef UNIV_IBUF_COUNT_DEBUG
3281 ut_ad(mtr->state == MTR_ACTIVE);
3282 ut_ad((rw_latch == RW_S_LATCH) || (rw_latch == RW_X_LATCH));
3284 mutex_enter(&block->
mutex);
3294 mutex_exit(&block->
mutex);
3301 buf_block_buf_fix_inc(block, file, line);
3303 mutex_exit(&block->
mutex);
3325 if (rw_latch == RW_S_LATCH) {
3326 success = rw_lock_s_lock_nowait(&(block->
lock),
3328 fix_type = MTR_MEMO_PAGE_S_FIX;
3332 fix_type = MTR_MEMO_PAGE_X_FIX;
3336 mutex_enter(&block->
mutex);
3337 buf_block_buf_fix_dec(block);
3338 mutex_exit(&block->
mutex);
3345 #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
3346 ut_a(++buf_dbg_counter % 5771 || buf_validate());
3350 #if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG
3351 ut_a(block->
page.file_page_was_freed == FALSE);
3354 #ifdef UNIV_IBUF_COUNT_DEBUG
3385 ut_ad(mtr->state == MTR_ACTIVE);
3397 mutex_enter(&block->
mutex);
3400 #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
3406 buf_block_buf_fix_inc(block, file, line);
3407 mutex_exit(&block->
mutex);
3409 fix_type = MTR_MEMO_PAGE_S_FIX;
3410 success = rw_lock_s_lock_nowait(&block->
lock, file, line);
3417 fix_type = MTR_MEMO_PAGE_X_FIX;
3423 mutex_enter(&block->
mutex);
3424 buf_block_buf_fix_dec(block);
3425 mutex_exit(&block->
mutex);
3431 #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
3432 ut_a(++buf_dbg_counter % 5771 || buf_validate());
3436 #if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG
3437 ut_a(block->
page.file_page_was_freed == FALSE);
3439 buf_block_dbg_add_level(block, SYNC_NO_ORDER_CHECK);
3443 #ifdef UNIV_IBUF_COUNT_DEBUG
3466 HASH_INVALIDATE(bpage, hash);
3467 #if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG
3468 bpage->file_page_was_freed = FALSE;
3494 #ifdef UNIV_DEBUG_VALGRIND
3499 UNIV_MEM_VALID(block->
frame, UNIV_PAGE_SIZE);
3503 buf_block_init_low(block);
3507 buf_page_init_low(&block->
page);
3513 if (UNIV_LIKELY(!hash_page)) {
3518 ut_a(buf_fix_count > 0);
3520 buf_pool_watch_remove(buf_pool, fold, hash_page);
3523 "InnoDB: Error: page %lu %lu already found"
3524 " in the hash table: %p, %p\n",
3527 (
const void*) hash_page, (
const void*) block);
3528 #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
3529 mutex_exit(&block->
mutex);
3541 ut_d(block->
page.in_page_hash = TRUE);
3543 fold, &block->
page);
3565 ib_int64_t tablespace_version,
3592 && !
ibuf_page(space, zip_size, offset, &mtr)) {
3602 if (zip_size && UNIV_LIKELY(!unzip)
3621 mutex_enter(&block->
mutex);
3623 mutex_exit(&block->
mutex);
3631 space, tablespace_version)) {
3634 *err = DB_TABLESPACE_DELETED;
3640 bpage = &block->
page;
3641 mutex_enter(&block->
mutex);
3645 buf_page_init(space, offset, fold, block);
3662 if (UNIV_UNLIKELY(zip_size)) {
3673 mutex_exit(&block->
mutex);
3675 mutex_enter(&block->
mutex);
3676 block->
page.
zip.
data =
static_cast<unsigned char *
>(data);
3687 mutex_exit(&block->
mutex);
3707 if (UNIV_UNLIKELY(lru)) {
3710 buf_pool, space, offset, fold);
3729 bpage->
zip.
data =
static_cast<unsigned char *
>(data);
3732 UNIV_MEM_DESC(bpage->
zip.
data,
3735 buf_page_init_low(bpage);
3738 bpage->
space = space;
3743 bpage->in_page_hash = FALSE;
3744 bpage->in_zip_hash = FALSE;
3745 bpage->in_flush_list = FALSE;
3746 bpage->in_free_list = FALSE;
3747 bpage->in_LRU_list = FALSE;
3750 ut_d(bpage->in_page_hash = TRUE);
3752 if (UNIV_LIKELY_NULL(watch_page)) {
3755 ut_a(buf_fix_count > 0);
3758 buf_pool_watch_remove(buf_pool, fold, watch_page);
3810 ut_ad(mtr->state == MTR_ACTIVE);
3811 ut_ad(space || !zip_size);
3820 buf_pool, space, offset, fold);
3825 #ifdef UNIV_IBUF_COUNT_DEBUG
3826 ut_a(ibuf_count_get(space, offset) == 0);
3828 #if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG
3829 block->
page.file_page_was_freed = FALSE;
3844 if (buf_debug_prints) {
3845 fprintf(stderr,
"Creating space %lu page %lu to buffer\n",
3846 (ulong) space, (ulong) offset);
3852 mutex_enter(&block->
mutex);
3854 buf_page_init(space, offset, fold, block);
3859 buf_block_buf_fix_inc(block, __FILE__, __LINE__);
3871 rw_lock_x_lock(&block->
lock);
3874 mutex_exit(&block->
mutex);
3882 mutex_enter(&block->
mutex);
3883 block->
page.
zip.
data =
static_cast<unsigned char *
>(data);
3894 rw_lock_x_unlock(&block->
lock);
3903 mutex_exit(&block->
mutex);
3913 frame = block->
frame;
3927 #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
3928 ut_a(++buf_dbg_counter % 357 || buf_validate());
3930 #ifdef UNIV_IBUF_COUNT_DEBUG
3964 ulint read_space_id;
3990 if (bpage->
space == TRX_SYS_SPACE
3995 " InnoDB: Error: reading page %lu\n"
3996 "InnoDB: which is in the"
3997 " doublewrite buffer!\n",
3999 }
else if (!read_space_id && !read_page_no) {
4001 }
else if ((bpage->
space
4002 && bpage->
space != read_space_id)
4003 || bpage->
offset != read_page_no) {
4011 " InnoDB: Error: space id and page n:o"
4012 " stored in the page\n"
4013 "InnoDB: read in are %lu:%lu,"
4014 " should be %lu:%lu!\n",
4015 (ulong) read_space_id, (ulong) read_page_no,
4016 (ulong) bpage->
space,
4027 "InnoDB: Database page corruption on disk"
4029 "InnoDB: file read of page %lu.\n"
4030 "InnoDB: You may have to recover"
4031 " from a backup.\n",
4035 "InnoDB: Database page corruption on disk"
4037 "InnoDB: file read of page %lu.\n"
4038 "InnoDB: You may have to recover"
4039 " from a backup.\n",
4041 fputs(
"InnoDB: It is also possible that"
4043 "InnoDB: system has corrupted its"
4045 "InnoDB: and rebooting your computer"
4048 "InnoDB: If the corrupt page is an index page\n"
4049 "InnoDB: you can also try to"
4050 " fix the corruption\n"
4051 "InnoDB: by dumping, dropping,"
4052 " and reimporting\n"
4053 "InnoDB: the corrupt table."
4054 " You can use CHECK\n"
4055 "InnoDB: TABLE to scan your"
4056 " table for corruption.\n"
4058 REFMAN
"forcing-innodb-recovery.html\n"
4059 "InnoDB: about forcing recovery.\n", stderr);
4062 fputs(
"InnoDB: Ending processing because of"
4063 " a corrupt database page.\n",
4086 #ifdef UNIV_IBUF_COUNT_DEBUG
4112 rw_lock_x_unlock_gen(&((
buf_block_t*) bpage)->lock,
4125 rw_lock_s_unlock_gen(&((
buf_block_t*) bpage)->lock,
4138 if (buf_debug_prints) {
4139 fprintf(stderr,
"Has %s page space %lu page no %lu\n",
4155 buf_all_freed_instance(
4166 chunk = buf_pool->
chunks;
4168 for (i = buf_pool->
n_chunks; i--; chunk++) {
4170 const buf_block_t* block = buf_chunk_not_freed(chunk);
4172 if (UNIV_LIKELY_NULL(block)) {
4174 "Page %lu %lu still fixed or dirty\n",
4190 buf_pool_invalidate_instance(
4212 if (buf_pool->
n_flush[i] > 0) {
4221 ut_ad(buf_all_freed_instance(buf_pool));
4239 memset(&buf_pool->
stat, 0x00,
sizeof(buf_pool->
stat));
4261 #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
4267 buf_pool_validate_instance(
4274 ulint n_single_flush = 0;
4275 ulint n_lru_flush = 0;
4276 ulint n_list_flush = 0;
4286 chunk = buf_pool->
chunks;
4290 for (i = buf_pool->
n_chunks; i--; chunk++) {
4295 for (j = chunk->
size; j--; block++) {
4297 mutex_enter(&block->
mutex);
4316 #ifdef UNIV_IBUF_COUNT_DEBUG
4370 mutex_exit(&block->
mutex);
4411 ut_ad(b->in_flush_list);
4461 if (n_lru + n_free > buf_pool->
curr_size + n_zip) {
4462 fprintf(stderr,
"n LRU %lu, n free %lu, pool %lu zip %lu\n",
4463 (ulong) n_lru, (ulong) n_free,
4464 (ulong) buf_pool->
curr_size, (ulong) n_zip);
4470 fprintf(stderr,
"Free list len %lu, free blocks %lu\n",
4482 ut_a(buf_LRU_validate());
4483 ut_a(buf_flush_validate(buf_pool));
4503 buf_pool_validate_instance(buf_pool);
4510 #if defined UNIV_DEBUG_PRINT || defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
4519 index_id_t* index_ids;
4533 index_ids = mem_alloc(size *
sizeof *index_ids);
4534 counts = mem_alloc(
sizeof(ulint) * size);
4540 "buf_pool size %lu\n"
4541 "database pages %lu\n"
4543 "modified database pages %lu\n"
4544 "n pending decompressions %lu\n"
4545 "n pending reads %lu\n"
4546 "n pending flush LRU %lu list %lu single page %lu\n"
4547 "pages made young %lu, not young %lu\n"
4548 "pages read %lu, created %lu, written %lu\n",
4570 chunk = buf_pool->
chunks;
4572 for (i = buf_pool->
n_chunks; i--; chunk++) {
4574 ulint n_blocks = chunk->
size;
4576 for (; n_blocks--; block++) {
4586 while (j < n_found) {
4588 if (index_ids[j] ==
id) {
4607 for (i = 0; i < n_found; i++) {
4608 index = dict_index_get_if_in_cache(index_ids[i]);
4611 "Block count for index %llu in buffer is about %lu",
4612 (ullint) index_ids[i],
4626 ut_a(buf_pool_validate_instance(buf_pool));
4642 buf_print_instance(buf_pool);
4653 buf_get_latched_pages_number_instance(
4660 ulint fixed_pages_number = 0;
4664 chunk = buf_pool->
chunks;
4666 for (i = buf_pool->
n_chunks; i--; chunk++) {
4672 for (j = chunk->
size; j--; block++) {
4679 mutex_enter(&block->
mutex);
4684 fixed_pages_number++;
4687 mutex_exit(&block->
mutex);
4702 fixed_pages_number++;
4709 ut_ad(b->in_flush_list);
4715 fixed_pages_number++;
4736 return(fixed_pages_number);
4744 buf_get_latched_pages_number(
void)
4748 ulint total_latched_pages = 0;
4755 total_latched_pages += buf_get_latched_pages_number_instance(
4759 return(total_latched_pages);
4802 ulint flush_list_len = 0;
4806 ratio = (100 * flush_list_len) / (1 + lru_len + free_len);
4817 buf_stats_aggregate_pool_info(
4825 ut_a(total_info && pool_info);
4828 if (total_info == pool_info) {
4875 buf_stats_get_pool_info(
4883 time_t current_time;
4884 double time_elapsed;
4887 pool_info = &all_pool_info[pool_id];
4921 current_time = time(NULL);
4922 time_elapsed = 0.001 + difftime(current_time,
5004 buf_print_io_instance(
5012 "Buffer pool size %lu\n"
5013 "Free buffers %lu\n"
5014 "Database pages %lu\n"
5015 "Old database pages %lu\n"
5016 "Modified db pages %lu\n"
5017 "Pending reads %lu\n"
5018 "Pending writes: LRU %lu, flush list %lu, single page %lu\n",
5030 "Pages made young %lu, not young %lu\n"
5031 "%.2f youngs/s, %.2f non-youngs/s\n"
5032 "Pages read %lu, created %lu, written %lu\n"
5033 "%.2f reads/s, %.2f creates/s, %.2f writes/s\n",
5047 "Buffer pool hit rate %lu / 1000,"
5048 " young-making rate %lu / 1000 not %lu / 1000\n",
5056 fputs(
"No buffer pool page gets since the last printout\n",
5061 fprintf(file,
"Pages read ahead %.2f/s,"
5062 " evicted without access %.2f/s\n",
5069 "LRU len: %lu, unzip_LRU len: %lu\n"
5070 "I/O sum[%lu]:cur[%lu], unzip sum[%lu]:cur[%lu]\n",
5091 if (srv_buf_pool_instances > 1) {
5093 srv_buf_pool_instances + 1) *
sizeof *pool_info);
5097 ut_a(srv_buf_pool_instances == 1);
5109 buf_stats_get_pool_info(buf_pool, i, pool_info);
5113 if (srv_buf_pool_instances > 1) {
5114 buf_stats_aggregate_pool_info(pool_info_total,
5120 buf_print_io_instance(pool_info_total, file);
5124 if (srv_buf_pool_instances > 1) {
5125 fputs(
"----------------------\n"
5126 "INDIVIDUAL BUFFER POOL INFO\n"
5127 "----------------------\n", file);
5130 fprintf(file,
"---BUFFER POOL %lu\n", i);
5131 buf_print_io_instance(&pool_info[i], file);
5183 if (!buf_all_freed_instance(buf_pool)) {
5205 for (i = 0; i < srv_buf_pool_instances && ret; i++) {
5225 Code currently not used
5251 buf_page_init_for_backup_restore(
5268 ut_ad(zip_size <= UNIV_PAGE_SIZE);
UNIV_INLINE void buf_buddy_free(buf_pool_t *buf_pool, void *buf, ulint size) __attribute__((nonnull))
#define UT_LIST_GET_LEN(BASE)
UNIV_INTERN ibool ibuf_page_low(ulint space, ulint zip_size, ulint page_no, const char *file, ulint line, mtr_t *mtr) __attribute__((warn_unused_result))
#define TRX_UNDO_PAGE_HDR
#define buf_page_get_with_no_latch(SP, ZS, OF, MTR)
ulint n_pages_not_made_young
UNIV_INTERN ibool UNIV_INTERN ibool page_zip_decompress(page_zip_des_t *page_zip, page_t *page, ibool all) __attribute__((nonnull(1
#define buf_pool_mutex_enter(b)
time_t last_printout_time
UNIV_INTERN void buf_LRU_make_block_young(buf_page_t *bpage)
#define rw_lock_create(K, L, level)
buf_page_t watch[BUF_POOL_WATCH_SIZE]
#define UT_LIST_GET_NEXT(NAME, N)
The buffer pool statistics structure.
UNIV_INLINE ulint page_get_space_id(const page_t *page)
UNIV_INTERN ulint buf_calc_page_old_checksum(const byte *page)
#define FIL_PAGE_IBUF_FREE_LIST
UNIV_INLINE ibool buf_page_belongs_to_unzip_LRU(const buf_page_t *bpage) __attribute__((pure))
ulint n_pending_flush_single_page
UNIV_INLINE page_t * page_align(const void *ptr) __attribute__((const ))
ib_uint64_t newest_modification
UNIV_INTERN ulint ut_time_ms(void)
UNIV_INLINE ulint page_get_page_no(const page_t *page)
#define UT_LIST_VALIDATE(NAME, TYPE, BASE, ASSERTION)
UNIV_INTERN void buf_refresh_io_stats(buf_pool_t *buf_pool)
UNIV_INLINE void buf_block_set_state(buf_block_t *block, enum buf_page_state state)
UNIV_INTERN ibool buf_page_optimistic_get(ulint rw_latch, buf_block_t *block, ib_uint64_t modify_clock, const char *file, ulint line, mtr_t *mtr)
UNIV_INLINE ulint buf_page_get_page_no(const buf_page_t *bpage) __attribute__((pure))
#define FIL_PAGE_TYPE_ALLOCATED
UNIV_INLINE ulint buf_block_get_zip_size(const buf_block_t *block) __attribute__((pure))
UNIV_INTERN buf_page_t * buf_page_init_for_read(ulint *err, ulint mode, ulint space, ulint zip_size, ibool unzip, ib_int64_t tablespace_version, ulint offset)
UNIV_INLINE void page_zip_des_init(page_zip_des_t *page_zip)
double pages_evicted_rate
UNIV_INTERN buf_page_t * buf_page_get_zip(ulint space, ulint zip_size, ulint offset)
#define BUF_GET_IF_IN_POOL
UNIV_INTERN void buf_refresh_io_stats_all(void)
UNIV_INTERN void buf_page_print(const byte *read_buf, ulint zip_size)
UNIV_INTERN ib_time_t ut_time(void)
#define FIL_PAGE_SPACE_OR_CHKSUM
UNIV_INTERN ibool buf_pool_check_no_pending_io(void)
UNIV_INTERN void buf_pool_resize(void)
UNIV_INLINE ibool ibuf_inside(const mtr_t *mtr) __attribute__((nonnull
UNIV_INTERN void buf_get_total_list_len(ulint *LRU_len, ulint *free_len, ulint *flush_list_len)
#define FIL_PAGE_TYPE_BLOB
#define FIL_PAGE_TYPE_ZBLOB2
#define BUF_READ_IBUF_PAGES_ONLY
UNIV_INTERN ibool buf_flush_ready_for_replace(buf_page_t *bpage)
UNIV_INLINE enum buf_flush buf_page_get_flush_type(const buf_page_t *bpage) __attribute__((pure))
UNIV_INTERN void ut_print_buf(FILE *file, const void *buf, ulint len)
UNIV_INTERN os_event_t os_event_create(const char *name)
UNIV_INTERN ulint buf_read_ahead_linear(ulint space, ulint zip_size, ulint offset, ibool inside_ibuf)
UNIV_INTERN void buf_LRU_block_free_non_file_page(buf_block_t *block)
UNIV_INLINE ibool buf_page_in_file(const buf_page_t *bpage) __attribute__((pure))
UNIV_INTERN void buf_reset_check_index_page_at_flush(ulint space, ulint offset)
UNIV_INTERN void os_mem_free_large(void *ptr, ulint size)
UNIV_INTERN void buf_flush_write_complete(buf_page_t *bpage)
UNIV_INTERN hash_table_t * hash_create(ulint n)
UNIV_INTERN ibool buf_page_is_corrupted(const byte *read_buf, ulint zip_size)
UNIV_INLINE void buf_block_set_file_page(buf_block_t *block, ulint space, ulint page_no)
#define recv_recover_page(jri, block)
UNIV_INTERN ulint fil_space_get_zip_size(ulint id)
UNIV_INLINE buf_page_t * buf_page_hash_get_low(buf_pool_t *buf_pool, ulint space, ulint offset, ulint fold)
#define FIL_PAGE_TYPE_XDES
UNIV_INLINE void buf_pool_mutex_enter_all(void)
#define FIL_PAGE_FILE_FLUSH_LSN
#define HASH_MIGRATE(OLD_TABLE, NEW_TABLE, NODE_TYPE, PTR_NAME, FOLD_FUNC)
UNIV_INTERN void * os_mem_alloc_large(ulint *n)
UNIV_INTERN ibool rw_lock_is_locked(rw_lock_t *lock, ulint lock_type)
UNIV_INTERN void buf_relocate(buf_page_t *bpage, buf_page_t *dpage) __attribute__((nonnull))
UNIV_INTERN void btr_search_sys_create(ulint hash_size)
UNIV_INTERN void buf_flush_free_margin(buf_pool_t *buf_pool)
UNIV_INLINE void buf_page_set_old(buf_page_t *bpage, ibool old)
UNIV_INLINE ulint lock_rec_hash(ulint space, ulint page_no)
#define log_flush_order_mutex_enter()
#define FIL_PAGE_TYPE_TRX_SYS
ibool check_index_page_at_flush
#define buf_flush_list_mutex_enter(b)
UNIV_INLINE unsigned buf_page_is_accessed(const buf_page_t *bpage) __attribute__((nonnull
UNIV_INLINE void buf_pool_mutex_exit_all(void)
UNIV_INTERN void btr_search_disable(void)
UNIV_INTERN ibool buf_LRU_search_and_free_block(buf_pool_t *buf_pool, ulint n_iterations)
UNIV_INLINE void ibuf_mtr_start(mtr_t *mtr) __attribute__((nonnull))
#define HASH_INSERT(TYPE, NAME, TABLE, FOLD, DATA)
#define BUF_READ_ANY_PAGE
ulint srv_buf_pool_curr_size
UNIV_INLINE ibool rw_lock_x_lock_func_nowait(rw_lock_t *lock, const char *file_name, ulint line)
#define BUF_NO_CHECKSUM_MAGIC
UNIV_INLINE void rw_lock_s_lock_func(rw_lock_t *lock, ulint pass, const char *file_name, ulint line)
UNIV_INLINE ulint buf_page_address_fold(ulint space, ulint offset) __attribute__((const ))
buf_LRU_stat_t buf_LRU_stat_sum
The buffer pool structure.
UNIV_INTERN void rw_lock_x_lock_func(rw_lock_t *lock, ulint pass, const char *file_name, ulint line)
UNIV_INTERN void hash_table_free(hash_table_t *table)
UNIV_INLINE ulint ut_min(ulint n1, ulint n2)
UNIV_INTERN enum buf_lru_free_block_status buf_LRU_free_block(buf_page_t *bpage, ibool zip) __attribute__((nonnull))
ulint n_flush[BUF_FLUSH_N_TYPES]
UNIV_INTERN void ibuf_merge_or_delete_for_page(buf_block_t *block, ulint space, ulint page_no, ulint zip_size, ibool update_ibuf_bitmap)
UNIV_INTERN dict_index_t * dict_index_find_on_id_low(index_id_t id)
UNIV_INLINE ulint buf_block_get_page_no(const buf_block_t *block) __attribute__((pure))
UNIV_INLINE ibool buf_page_peek_if_too_old(const buf_page_t *bpage)
UNIV_INTERN const buf_block_t * buf_page_try_get_func(ulint space_id, ulint page_no, const char *file, ulint line, mtr_t *mtr)
#define UT_LIST_REMOVE(NAME, BASE, N)
UNIV_INTERN ulint buf_pool_init(ulint size, ulint n_instances)
UNIV_INLINE index_id_t btr_page_get_index_id(const page_t *page)
double pages_written_rate
UNIV_INLINE void ibuf_mtr_commit(mtr_t *mtr) __attribute__((nonnull))
UNIV_INTERN ibool log_peek_lsn(ib_uint64_t *lsn)
UNIV_INTERN ib_uint64_t buf_pool_get_oldest_modification(void)
UNIV_INLINE ulint buf_page_get_zip_size(const buf_page_t *bpage) __attribute__((pure))
UNIV_INLINE enum buf_page_state buf_block_get_state(const buf_block_t *block) __attribute__((pure))
ulint not_young_making_delta
UNIV_INLINE buf_pool_t * buf_pool_from_array(ulint index)
UNIV_INTERN ibool buf_read_page(ulint space, ulint zip_size, ulint offset)
UNIV_INTERN ibool buf_page_peek_if_search_hashed(ulint space, ulint offset)
UNIV_INTERN void buf_print_io(FILE *file)
UNIV_INTERN ibool buf_page_get_known_nowait(ulint rw_latch, buf_block_t *block, ulint mode, const char *file, ulint line, mtr_t *mtr)
UNIV_INLINE void * ut_align(const void *ptr, ulint align_no)
UNIV_INTERN void buf_LRU_make_block_old(buf_page_t *bpage)
#define ut_2pow_round(n, m)
#define FIL_PAGE_TYPE_ZBLOB
UNIV_INTERN void buf_page_io_complete(buf_page_t *bpage)
UNIV_INTERN void buf_pool_invalidate(void)
UNIV_INTERN void os_thread_sleep(ulint tm)
ulint n_pages_not_made_young
UNIV_INLINE ulint buf_pool_index(const buf_pool_t *buf_pool) __attribute__((nonnull
#define FIL_PAGE_TYPE_SYS
UNIV_INLINE enum buf_page_state buf_page_get_state(const buf_page_t *bpage)
UNIV_INTERN void buf_unzip_LRU_add_block(buf_block_t *block, ibool old)
UNIV_INLINE void buf_block_set_io_fix(buf_block_t *block, enum buf_io_fix io_fix)
UNIV_INTERN buf_block_t * buf_block_alloc(buf_pool_t *buf_pool)
UNIV_INLINE enum buf_io_fix buf_page_get_io_fix(const buf_page_t *bpage) __attribute__((pure))
UNIV_INTERN buf_block_t * buf_page_create(ulint space, ulint offset, ulint zip_size, mtr_t *mtr)
UNIV_INLINE void page_zip_set_size(page_zip_des_t *page_zip, ulint size)
buf_pool_t * buf_pool_ptr
double pages_readahead_rate
#define UT_LIST_GET_PREV(NAME, N)
#define UT_LIST_INSERT_AFTER(NAME, BASE, NODE1, NODE2)
buf_LRU_stat_t buf_LRU_stat_cur
UNIV_INTERN ulint buf_get_n_pending_ios(void)
UNIV_INLINE void buf_page_set_accessed(buf_page_t *bpage, ulint time_ms) __attribute__((nonnull))
UNIV_INLINE buf_page_t * buf_page_hash_get(buf_pool_t *buf_pool, ulint space, ulint offset)
UNIV_INTERN ulint fil_page_get_type(const byte *page)
UNIV_INLINE ibool buf_page_is_old(const buf_page_t *bpage) __attribute__((pure))
UNIV_INTERN void buf_pool_free(ulint n_instances)
UNIV_INTERN buf_block_t * buf_page_get_gen(ulint space, ulint zip_size, ulint offset, ulint rw_latch, buf_block_t *guess, ulint mode, const char *file, ulint line, mtr_t *mtr)
UNIV_INTERN ibool buf_pointer_is_block_field(const void *ptr)
#define UT_LIST_ADD_LAST(NAME, BASE, N)
#define UT_LIST_GET_FIRST(BASE)
UNIV_INTERN ibool buf_all_freed(void)
ulint n_pending_flush_lru
UNIV_INLINE void * buf_buddy_alloc(buf_pool_t *buf_pool, ulint size, ibool *lru) __attribute__((malloc))
UNIV_INLINE ulint buf_page_get_space(const buf_page_t *bpage) __attribute__((pure))
UNIV_INTERN buf_page_t * buf_pool_watch_set(ulint space, ulint offset, ulint fold) UNIV_WARN_UNUSED_RESULT
UNIV_INLINE ulint ut_fold_binary(const byte *str, ulint len) __attribute__((pure))
ibool init_flush[BUF_FLUSH_N_TYPES]
double page_made_young_rate
UNIV_INTERN void btr_search_drop_page_hash_index(buf_block_t *block)
UNIV_INLINE buf_pool_t * buf_pool_from_bpage(const buf_page_t *bpage)
UNIV_INLINE void mtr_memo_push(mtr_t *mtr, void *object, ulint type)
UNIV_INLINE buf_block_t * buf_block_hash_get(buf_pool_t *buf_pool, ulint space, ulint offset)
UNIV_INTERN ibool buf_zip_decompress(buf_block_t *block, ibool check)
UNIV_INTERN ulint buf_calc_page_new_checksum(const byte *page)
UNIV_INTERN ulint buf_get_modified_ratio_pct(void)
#define UT_LIST_INIT(BASE)
UNIV_INLINE void buf_page_set_io_fix(buf_page_t *bpage, enum buf_io_fix io_fix)
#define buf_flush_list_mutex_exit(b)
UNIV_INTERN byte UNIV_INTERN ulint page_zip_calc_checksum(const void *data, ulint size) __attribute__((nonnull))
#define log_flush_order_mutex_exit()
UNIV_INLINE ulint buf_block_get_space(const buf_block_t *block) __attribute__((pure))
ibool recv_no_ibuf_operations
os_event_t no_flush[BUF_FLUSH_N_TYPES]
UNIV_INTERN void buf_flush_wait_batch_end(buf_pool_t *buf_pool, enum buf_flush type)
#define UT_LIST_ADD_FIRST(NAME, BASE, N)
UNIV_INLINE ulint mach_read_from_4(const byte *b) __attribute__((nonnull
UNIV_INTERN void buf_LRU_add_block(buf_page_t *bpage, ibool old)
#define BUF_GET_IF_IN_POOL_OR_WATCH
UNIV_INTERN void ut_print_timestamp(FILE *file)
UNIV_INTERN void buf_get_total_stat(buf_pool_stat_t *tot_stat)
UNIV_INLINE void mach_write_to_2(byte *b, ulint n)
UNIV_INTERN ibool buf_pool_watch_occurred(ulint space, ulint offset) UNIV_WARN_UNUSED_RESULT
ib_uint64_t oldest_modification
#define TRX_UNDO_PAGE_TYPE
UNIV_INLINE buf_pool_t * buf_pool_from_block(const buf_block_t *block)
UNIV_INTERN void buf_pool_watch_unset(ulint space, ulint offset)
UNIV_INLINE mutex_t * buf_page_get_mutex(const buf_page_t *bpage) __attribute__((pure))
#define FIL_PAGE_END_LSN_OLD_CHKSUM
UNIV_INLINE buf_pool_t * buf_pool_get(ulint space, ulint offset)
UNIV_INTERN ibool fil_tablespace_deleted_or_being_deleted_in_mem(ulint id, ib_int64_t version)
UNIV_INTERN buf_block_t * buf_block_align(const byte *ptr)
ulint srv_buf_pool_old_size
UNIV_INTERN void buf_pool_drop_hash_index(void)
UNIV_INTERN void buf_page_make_young(buf_page_t *bpage)
#define ibuf_page(space, zip_size, page_no, mtr)
#define HASH_DELETE(TYPE, NAME, TABLE, FOLD, DATA)
UNIV_INTERN ulint buf_flush_LRU(buf_pool_t *buf_pool, ulint min_n)
UNIV_INLINE ibool recv_recovery_is_on(void)
double pages_created_rate
#define buf_pool_mutex_own(b)
UNIV_INTERN ulint buf_LRU_old_ratio_update(uint old_pct, ibool adjust)
#define FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID
UNIV_INLINE ulint mach_read_from_2(const byte *b) __attribute__((nonnull
UNIV_INTERN void dict_index_name_print(FILE *file, trx_t *trx, const dict_index_t *index)
UNIV_INLINE ib_uint64_t mach_read_from_8(const byte *b) __attribute__((nonnull
#define BUF_POOL_WATCH_SIZE
#define FIL_PAGE_IBUF_BITMAP
double page_not_made_young_rate
ulint srv_buf_pool_instances
UNIV_INLINE void buf_block_free(buf_block_t *block)
UNIV_INLINE enum buf_io_fix buf_block_get_io_fix(const buf_block_t *block) __attribute__((pure))
#define FIL_PAGE_TYPE_FSP_HDR
UNIV_INTERN ulint buf_get_free_list_len(void)
#define buf_pool_mutex_exit(b)
UNIV_INTERN ibool trx_doublewrite_page_inside(ulint page_no)
UNIV_INLINE ibool ibuf_bitmap_page(ulint zip_size, ulint page_no)
#define UT_LIST_GET_LAST(BASE)
UNIV_INTERN void buf_LRU_insert_zip_clean(buf_page_t *bpage)
ulint n_pending_flush_list
unsigned freed_page_clock
UNIV_INLINE ulint buf_pool_get_curr_size(void)
UNIV_INLINE ulint page_zip_get_size(const page_zip_des_t *page_zip) __attribute__((nonnull
UNIV_INTERN void btr_search_enable(void)
#define BUF_PEEK_IF_IN_POOL
UNIV_INTERN void buf_flush_relocate_on_flush_list(buf_page_t *bpage, buf_page_t *dpage)
UNIV_INTERN buf_block_t * buf_LRU_get_free_block(buf_pool_t *buf_pool) __attribute__((nonnull
UNIV_INTERN ibool buf_pool_watch_is_sentinel(buf_pool_t *buf_pool, const buf_page_t *bpage) UNIV_WARN_UNUSED_RESULT