summaryrefslogtreecommitdiff
path: root/innobase/buf/buf0flu.c
diff options
context:
space:
mode:
authorunknown <serg@serg.mylan>2004-08-18 19:57:55 +0200
committerunknown <serg@serg.mylan>2004-08-18 19:57:55 +0200
commit945625ebaa21468fdf0b2a3c1786fca50bdd5aa2 (patch)
tree8ac7985dc9b6caddd1c2402ef8606e4a4cd85ada /innobase/buf/buf0flu.c
parent992ff0a27274c0c95da2f4ea1496bb9356201f89 (diff)
parent0c6b96658e96cc604c9c5fedb41a5e43bad4f74b (diff)
downloadmariadb-git-945625ebaa21468fdf0b2a3c1786fca50bdd5aa2.tar.gz
manually merged
BitKeeper/etc/logging_ok: auto-union BitKeeper/deleted/.del-mytest-old.c~5237697b30cf59e4: Auto merged Build-tools/Bootstrap: Auto merged Build-tools/mysql-copyright: Auto merged configure.in: Auto merged BitKeeper/deleted/.del-mysql_fix_privilege_tables.sql: Auto merged VC++Files/innobase/innobase.dsp: Auto merged client/mysql.cc: Auto merged include/my_global.h: Auto merged innobase/dict/dict0crea.c: Auto merged innobase/dict/dict0dict.c: Auto merged innobase/include/mtr0log.h: Auto merged innobase/include/mtr0log.ic: Auto merged innobase/include/srv0srv.h: Auto merged innobase/include/ut0dbg.h: Auto merged innobase/lock/lock0lock.c: Auto merged innobase/os/os0file.c: Auto merged innobase/row/row0mysql.c: Auto merged innobase/row/row0sel.c: Auto merged innobase/srv/srv0srv.c: Auto merged innobase/ut/ut0dbg.c: Auto merged innobase/ut/ut0mem.c: Auto merged libmysql/Makefile.am: Auto merged libmysql/Makefile.shared: Auto merged libmysql/conf_to_src.c: Auto merged libmysql/dll.c: Auto merged libmysql/errmsg.c: Auto merged libmysql/manager.c: Auto merged libmysql_r/Makefile.am: Auto merged myisam/mi_key.c: Auto merged mysql-test/Makefile.am: Auto merged mysql-test/mysql-test-run.sh: Auto merged mysql-test/r/having.result: Auto merged mysql-test/r/heap.result: Auto merged mysql-test/r/type_date.result: Auto merged mysql-test/r/type_float.result: Auto merged mysql-test/t/having.test: Auto merged mysql-test/t/heap.test: Auto merged mysql-test/t/type_date.test: Auto merged mysql-test/t/type_float.test: Auto merged mysql-test/t/type_uint.test: Auto merged scripts/make_binary_distribution.sh: Auto merged scripts/make_win_src_distribution.sh: Auto merged sql/Makefile.am: Auto merged sql/field.h: Auto merged sql/ha_heap.cc: Auto merged sql/item_func.cc: Auto merged sql/item_func.h: Auto merged sql/item_sum.h: Auto merged sql/lock.cc: Auto merged sql/log.cc: Auto merged sql/protocol.cc: Auto merged sql/repl_failsafe.cc: Auto merged sql/sql_acl.cc: Auto merged sql/sql_analyse.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_parse.cc: Auto merged sql/share/czech/errmsg.txt: Auto merged sql/share/danish/errmsg.txt: Auto merged sql/share/dutch/errmsg.txt: Auto merged sql/share/english/errmsg.txt: Auto merged sql/share/estonian/errmsg.txt: Auto merged sql/share/french/errmsg.txt: Auto merged sql/sql_select.cc: Auto merged sql/sql_table.cc: Auto merged sql/share/greek/errmsg.txt: Auto merged sql/share/hungarian/errmsg.txt: Auto merged sql/share/japanese/errmsg.txt: Auto merged sql/share/korean/errmsg.txt: Auto merged sql/share/norwegian-ny/errmsg.txt: Auto merged sql/share/norwegian/errmsg.txt: Auto merged sql/share/polish/errmsg.txt: Auto merged sql/share/portuguese/errmsg.txt: Auto merged sql/share/romanian/errmsg.txt: Auto merged sql/share/russian/errmsg.txt: Auto merged sql/share/slovak/errmsg.txt: Auto merged sql/share/spanish/errmsg.txt: Auto merged sql/share/swedish/errmsg.txt: Auto merged sql/share/ukrainian/errmsg.txt: Auto merged
Diffstat (limited to 'innobase/buf/buf0flu.c')
-rw-r--r--innobase/buf/buf0flu.c53
1 files changed, 53 insertions, 0 deletions
diff --git a/innobase/buf/buf0flu.c b/innobase/buf/buf0flu.c
index cad51c224e2..964c396dd08 100644
--- a/innobase/buf/buf0flu.c
+++ b/innobase/buf/buf0flu.c
@@ -217,7 +217,9 @@ buf_flush_buffered_writes(void)
/*===========================*/
{
buf_block_t* block;
+ byte* write_buf;
ulint len;
+ ulint len2;
ulint i;
if (trx_doublewrite == NULL) {
@@ -244,6 +246,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)) {
@@ -272,6 +284,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;
@@ -282,6 +307,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 */
@@ -295,6 +336,18 @@ 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);
+ }
ut_a(block->state == BUF_BLOCK_FILE_PAGE);
fil_io(OS_FILE_WRITE | OS_AIO_SIMULATED_WAKE_LATER,