summaryrefslogtreecommitdiff
path: root/innobase
diff options
context:
space:
mode:
authorunknown <aivanov@mysql.com>2006-05-15 18:02:21 +0400
committerunknown <aivanov@mysql.com>2006-05-15 18:02:21 +0400
commitc55912b09ed31596502b693d1939b94aeb193279 (patch)
tree05700e58545e4fbc79491628d9ca1a20defa92d7 /innobase
parent3fa6432b09be41ddcc8dae2a8e12eacab5bb95a2 (diff)
downloadmariadb-git-c55912b09ed31596502b693d1939b94aeb193279.tar.gz
Applied innodb-5.0-ss547 snapshot.
Fix BUG#19542 "InnoDB doesn't increase the Handler_read_prev counter". innobase/os/os0file.c: Applied innodb-5.0-ss547 snapshot. Check the page trailers also after writing to disk. This improves the chances of diagnosing Bug 18886. os_file_check_page_trailers(): New function for checking that two copies of the LSN stamped on the pages match. os_aio_simulated_handle(): Call os_file_check_page_trailers() before and after os_file_write(). sql/ha_innodb.cc: Applied innodb-5.0-ss547 snapshot. Increment statistic counter in ha_innobase::index_prev().
Diffstat (limited to 'innobase')
-rw-r--r--innobase/os/os0file.c63
1 files changed, 38 insertions, 25 deletions
diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c
index 3b8f7576049..df819b73ea6 100644
--- a/innobase/os/os0file.c
+++ b/innobase/os/os0file.c
@@ -3700,6 +3700,37 @@ os_aio_posix_handle(
#endif
/**************************************************************************
+Do a 'last millisecond' check that the page end is sensible;
+reported page checksum errors from Linux seem to wipe over the page end. */
+static
+void
+os_file_check_page_trailers(
+/*========================*/
+ byte* combined_buf, /* in: combined write buffer */
+ ulint total_len) /* in: size of combined_buf, in bytes
+ (a multiple of UNIV_PAGE_SIZE) */
+{
+ ulint len;
+
+ for (len = 0; len + UNIV_PAGE_SIZE <= total_len;
+ len += UNIV_PAGE_SIZE) {
+ byte* buf = combined_buf + len;
+
+ if (memcmp(buf + (FIL_PAGE_LSN + 4), buf + (UNIV_PAGE_SIZE
+ - FIL_PAGE_END_LSN_OLD_CHKSUM + 4), 4)) {
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
+" InnoDB: ERROR: The page to be written seems corrupt!\n"
+"InnoDB: Writing a block of %lu bytes, currently at offset %lu\n",
+ (ulong)total_len, (ulong)len);
+ buf_page_print(buf);
+ fprintf(stderr,
+"InnoDB: ERROR: The page to be written seems corrupt!\n");
+ }
+ }
+}
+
+/**************************************************************************
Does simulated aio. This function should be called by an i/o-handler
thread. */
@@ -3736,7 +3767,6 @@ os_aio_simulated_handle(
ibool ret;
ulint n;
ulint i;
- ulint len2;
segment = os_aio_get_array_and_local_segment(&array, global_segment);
@@ -3943,33 +3973,16 @@ consecutive_loop:
(ulong) total_len);
ut_error;
}
-
- /* Do a 'last millisecond' check that the page end
- is sensible; reported page checksum errors from
- Linux seem to wipe over the page end */
-
- for (len2 = 0; len2 + UNIV_PAGE_SIZE <= total_len;
- len2 += UNIV_PAGE_SIZE) {
- if (mach_read_from_4(combined_buf + len2
- + FIL_PAGE_LSN + 4)
- != mach_read_from_4(combined_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");
- 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");
- }
- }
+
+ os_file_check_page_trailers(combined_buf, total_len);
}
-
+
ret = os_file_write(slot->name, slot->file, combined_buf,
slot->offset, slot->offset_high, total_len);
+
+ if (array == os_aio_write_array) {
+ os_file_check_page_trailers(combined_buf, total_len);
+ }
} else {
ret = os_file_read(slot->file, combined_buf,
slot->offset, slot->offset_high, total_len);