diff options
Diffstat (limited to 'innobase/buf')
-rw-r--r-- | innobase/buf/buf0buf.c | 32 | ||||
-rw-r--r-- | innobase/buf/buf0flu.c | 19 |
2 files changed, 51 insertions, 0 deletions
diff --git a/innobase/buf/buf0buf.c b/innobase/buf/buf0buf.c index ee8e8b91f8d..4524fa1a4f9 100644 --- a/innobase/buf/buf0buf.c +++ b/innobase/buf/buf0buf.c @@ -331,6 +331,11 @@ buf_page_print( index->table_name, index->name); } + } else if (fil_page_get_type(read_buf) == FIL_PAGE_INODE) { + fprintf(stderr, "InnoDB: Page may be an 'inode' page\n"); + } else if (fil_page_get_type(read_buf) == FIL_PAGE_IBUF_FREE_LIST) { + fprintf(stderr, + "InnoDB: Page may be an insert buffer free list page\n"); } } @@ -351,6 +356,8 @@ buf_block_init( block->file_page_was_freed = FALSE; + block->check_index_page_at_flush = FALSE; + rw_lock_create(&(block->lock)); ut_ad(rw_lock_validate(&(block->lock))); @@ -617,6 +624,29 @@ buf_page_peek_block( } /************************************************************************ +Resets the check_index_page_at_flush field of a page if found in the buffer +pool. */ + +void +buf_reset_check_index_page_at_flush( +/*================================*/ + ulint space, /* in: space id */ + ulint offset) /* in: page number */ +{ + buf_block_t* block; + + mutex_enter_fast(&(buf_pool->mutex)); + + block = buf_page_hash_get(space, offset); + + if (block) { + block->check_index_page_at_flush = FALSE; + } + + mutex_exit(&(buf_pool->mutex)); +} + +/************************************************************************ Returns the current state of is_hashed of a page. FALSE if the page is not in the pool. NOTE that this operation does not fix the page in the pool if it is found there. */ @@ -1185,6 +1215,8 @@ buf_page_init( block->space = space; block->offset = offset; + block->check_index_page_at_flush = FALSE; + block->lock_hash_val = lock_rec_hash(space, offset); block->lock_mutex = NULL; diff --git a/innobase/buf/buf0flu.c b/innobase/buf/buf0flu.c index 4c6850af078..78bde60c9b2 100644 --- a/innobase/buf/buf0flu.c +++ b/innobase/buf/buf0flu.c @@ -15,6 +15,7 @@ Created 11/11/1995 Heikki Tuuri #include "ut0byte.h" #include "ut0lst.h" +#include "page0page.h" #include "fil0fil.h" #include "buf0buf.h" #include "buf0lru.h" @@ -225,6 +226,24 @@ buf_flush_buffered_writes(void) return; } + for (i = 0; i < trx_doublewrite->first_free; i++) { + block = trx_doublewrite->buf_block_arr[i]; + + if (block->check_index_page_at_flush + && !page_simple_validate(block->frame)) { + + buf_page_print(block->frame); + + ut_print_timestamp(stderr); + fprintf(stderr, + " InnoDB: Apparent corruption of an index page\n" + "InnoDB: to be written to data file. We intentionally crash server\n" + "InnoDB: to prevent corrupt data from ending up in data\n" + "InnoDB: files.\n"); + ut_a(0); + } + } + if (trx_doublewrite->first_free > TRX_SYS_DOUBLEWRITE_BLOCK_SIZE) { len = TRX_SYS_DOUBLEWRITE_BLOCK_SIZE * UNIV_PAGE_SIZE; } else { |