summaryrefslogtreecommitdiff
path: root/innobase
diff options
context:
space:
mode:
authorunknown <heikki@hundin.mysql.fi>2004-07-27 19:14:50 +0300
committerunknown <heikki@hundin.mysql.fi>2004-07-27 19:14:50 +0300
commit5e33eb8e732654594b89fb38ec4ca1f82665aa15 (patch)
tree229f8fae30532290635fa77510dffe25e491b11c /innobase
parenta79b4c32627ac9732a0a9d14299ef52ae4914322 (diff)
downloadmariadb-git-5e33eb8e732654594b89fb38ec4ca1f82665aa15.tar.gz
buf0flu.c, os0file.c:
Add more diagnostic code to determine when an lsn field gets corrupt; tracks a crash reported from one Itanium computer innobase/os/os0file.c: Add more diagnostic code to determine when an lsn field gets corrupt; tracks a crash reported from one Itanium computer innobase/buf/buf0flu.c: Add more diagnostic code to determine when an lsn field gets corrupt; tracks a crash reported from one Itanium computer
Diffstat (limited to 'innobase')
-rw-r--r--innobase/buf/buf0flu.c54
-rw-r--r--innobase/os/os0file.c3
2 files changed, 57 insertions, 0 deletions
diff --git a/innobase/buf/buf0flu.c b/innobase/buf/buf0flu.c
index 7456e5d6f61..9eb8076732d 100644
--- a/innobase/buf/buf0flu.c
+++ b/innobase/buf/buf0flu.c
@@ -213,7 +213,9 @@ buf_flush_buffered_writes(void)
/*===========================*/
{
buf_block_t* block;
+ byte* write_buf;
ulint len;
+ ulint len2;
ulint i;
if (trx_doublewrite == NULL) {
@@ -240,6 +242,16 @@ buf_flush_buffered_writes(void)
block = trx_doublewrite->buf_block_arr[i];
ut_a(block->state == BUF_BLOCK_FILE_PAGE);
+ if (mach_read_from_4(block->frame + FIL_PAGE_LSN + 4)
+ != mach_read_from_4(block->frame + UNIV_PAGE_SIZE
+ - FIL_PAGE_END_LSN_OLD_CHKSUM + 4)) {
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+" InnoDB: ERROR: The page to be written seems corrupt!\n"
+"InnoDB: The lsn fields do not match! Noticed in the buffer pool\n"
+"InnoDB: before posting to the doublewrite buffer.\n");
+ }
+
if (block->check_index_page_at_flush
&& !page_simple_validate(block->frame)) {
@@ -268,6 +280,19 @@ buf_flush_buffered_writes(void)
trx_doublewrite->block1, 0, len,
(void*)trx_doublewrite->write_buf, NULL);
+ write_buf = trx_doublewrite->write_buf;
+
+ for (len2 = 0; len2 + UNIV_PAGE_SIZE <= len; len2 += UNIV_PAGE_SIZE) {
+ if (mach_read_from_4(write_buf + len2 + FIL_PAGE_LSN + 4)
+ != mach_read_from_4(write_buf + len2 + UNIV_PAGE_SIZE
+ - FIL_PAGE_END_LSN_OLD_CHKSUM + 4)) {
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+" InnoDB: ERROR: The page to be written seems corrupt!\n"
+"InnoDB: The lsn fields do not match! Noticed in the doublewrite block1.\n");
+ }
+ }
+
if (trx_doublewrite->first_free > TRX_SYS_DOUBLEWRITE_BLOCK_SIZE) {
len = (trx_doublewrite->first_free
- TRX_SYS_DOUBLEWRITE_BLOCK_SIZE) * UNIV_PAGE_SIZE;
@@ -278,6 +303,22 @@ buf_flush_buffered_writes(void)
(void*)(trx_doublewrite->write_buf
+ TRX_SYS_DOUBLEWRITE_BLOCK_SIZE * UNIV_PAGE_SIZE),
NULL);
+
+ write_buf = trx_doublewrite->write_buf
+ + TRX_SYS_DOUBLEWRITE_BLOCK_SIZE * UNIV_PAGE_SIZE;
+ for (len2 = 0; len2 + UNIV_PAGE_SIZE <= len;
+ len2 += UNIV_PAGE_SIZE) {
+ if (mach_read_from_4(write_buf + len2
+ + FIL_PAGE_LSN + 4)
+ != mach_read_from_4(write_buf + len2
+ + UNIV_PAGE_SIZE
+ - FIL_PAGE_END_LSN_OLD_CHKSUM + 4)) {
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+" InnoDB: ERROR: The page to be written seems corrupt!\n"
+"InnoDB: The lsn fields do not match! Noticed in the doublewrite block2.\n");
+ }
+ }
}
/* Now flush the doublewrite buffer data to disk */
@@ -291,6 +332,19 @@ buf_flush_buffered_writes(void)
for (i = 0; i < trx_doublewrite->first_free; i++) {
block = trx_doublewrite->buf_block_arr[i];
+ if (mach_read_from_4(block->frame + FIL_PAGE_LSN + 4)
+ != mach_read_from_4(block->frame + UNIV_PAGE_SIZE
+ - FIL_PAGE_END_LSN_OLD_CHKSUM + 4)) {
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+" InnoDB: ERROR: The page to be written seems corrupt!\n"
+"InnoDB: The lsn fields do not match! Noticed in the buffer pool\n"
+"InnoDB: after posting and flushing the doublewrite buffer.\n"
+"InnoDB: Page buf fix count %lu, io fix %lu, state %lu\n",
+ (ulong)block->buf_fix_count, (ulong)block->io_fix,
+ (ulong)block->state);
+ }
+
fil_io(OS_FILE_WRITE | OS_AIO_SIMULATED_WAKE_LATER,
FALSE, block->space, block->offset, 0, UNIV_PAGE_SIZE,
(void*)block->frame, (void*)block);
diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c
index 8cb2b171328..a70333ba6ab 100644
--- a/innobase/os/os0file.c
+++ b/innobase/os/os0file.c
@@ -2736,6 +2736,9 @@ consecutive_loop:
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: ERROR: The page to be written seems corrupt!\n");
+ fprintf(stderr,
+"InnoDB: Writing a block of %lu bytes, currently writing at offset %lu\n",
+ (ulong)total_len, (ulong)len2);
buf_page_print(combined_buf + len2);
fprintf(stderr,
"InnoDB: ERROR: The page to be written seems corrupt!\n");