Commit c7798b78 authored by unknown's avatar unknown

os0file.c:

  Put 'last millisecond' test to make sure page checksum errors do not result from memory corruption in InnoDB
os0thread.c, configure.in:
  Make sure stack size in InnoDB threads in AIX is at least 32 kB


innobase/configure.in:
  Make sure stack size in InnoDB threads in AIX is at least 32 kB
innobase/os/os0thread.c:
  Make sure stack size in InnoDB threads in AIX is at least 32 kB
innobase/os/os0file.c:
  Put 'last millisecond' test to make sure page checksum errors do not result from memory corruption in InnoDB
parent 63cdfc4b
...@@ -89,6 +89,8 @@ case "$target_os" in ...@@ -89,6 +89,8 @@ case "$target_os" in
CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE -DUNIV_HPUX -DUNIV_HPUX10";; CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE -DUNIV_HPUX -DUNIV_HPUX10";;
hp*) hp*)
CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE -DUNIV_HPUX";; CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE -DUNIV_HPUX";;
aix*)
CFLAGS="$CFLAGS -DUNIV_AIX";;
irix*) irix*)
CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE";; CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE";;
osf*) osf*)
......
...@@ -11,6 +11,7 @@ Created 10/21/1995 Heikki Tuuri ...@@ -11,6 +11,7 @@ Created 10/21/1995 Heikki Tuuri
#include "ut0mem.h" #include "ut0mem.h"
#include "srv0srv.h" #include "srv0srv.h"
#include "fil0fil.h" #include "fil0fil.h"
#include "buf0buf.h"
#undef HAVE_FDATASYNC #undef HAVE_FDATASYNC
...@@ -2108,6 +2109,7 @@ os_aio_simulated_handle( ...@@ -2108,6 +2109,7 @@ os_aio_simulated_handle(
ibool ret; ibool ret;
ulint n; ulint n;
ulint i; ulint i;
ulint len2;
segment = os_aio_get_array_and_local_segment(&array, global_segment); segment = os_aio_get_array_and_local_segment(&array, global_segment);
...@@ -2263,6 +2265,29 @@ consecutive_loop: ...@@ -2263,6 +2265,29 @@ consecutive_loop:
/* Do the i/o with ordinary, synchronous i/o functions: */ /* Do the i/o with ordinary, synchronous i/o functions: */
if (slot->type == OS_FILE_WRITE) { if (slot->type == OS_FILE_WRITE) {
if (array == os_aio_write_array) {
/* 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 + 4)) {
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: ERROR: The page to be written seems corrupt!\n");
page_print(combined_buf + len2);
fprintf(stderr,
"InnoDB: ERROR: The page to be written seems corrupt!\n");
}
}
}
ret = os_file_write(slot->name, slot->file, combined_buf, ret = os_file_write(slot->name, slot->file, combined_buf,
slot->offset, slot->offset_high, total_len); slot->offset, slot->offset_high, total_len);
} else { } else {
......
...@@ -128,8 +128,28 @@ os_thread_create( ...@@ -128,8 +128,28 @@ os_thread_create(
pthread_attr_init(&attr); pthread_attr_init(&attr);
#ifdef UNIV_AIX
/* We must make sure a thread stack is at least 32 kB, otherwise
InnoDB might crash; we do not know if the default stack size on
AIX is always big enough. An empirical test on AIX-4.3 suggested
the size was 96 kB, though. */
ret = pthread_attr_setstacksize(&attr,
(size_t)(PTHREAD_STACK_MIN + 32 * 1024));
if (ret) {
fprintf(stderr,
"InnoDB: Error: pthread_attr_setstacksize returned %d\n", ret);
exit(1);
}
#endif
ret = pthread_create(&pthread, &attr, start_f, arg); ret = pthread_create(&pthread, &attr, start_f, arg);
if (ret) {
fprintf(stderr,
"InnoDB: Error: pthread_create returned %d\n", ret);
exit(1);
}
pthread_attr_destroy(&attr); pthread_attr_destroy(&attr);
if (srv_set_thread_priorities) { if (srv_set_thread_priorities) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment