srv0start.c, trx0sys.c:

  Let InnoDB to skip writing of pages from the doublewrite buffer if innodb_force_recovery=6; normally, if the page is corrupt AND the corresponding page in the doublewrite buffer is also corrupt, InnoDB calls exit(1)
parent 7e85affd
...@@ -1168,8 +1168,11 @@ innobase_start_or_create_for_mysql(void) ...@@ -1168,8 +1168,11 @@ innobase_start_or_create_for_mysql(void)
and restore them from the doublewrite buffer if and restore them from the doublewrite buffer if
possible */ possible */
if (srv_force_recovery < SRV_FORCE_NO_LOG_REDO) {
trx_sys_doublewrite_restore_corrupt_pages(); trx_sys_doublewrite_restore_corrupt_pages();
} }
}
srv_normalize_path_for_win(srv_arch_dir); srv_normalize_path_for_win(srv_arch_dir);
srv_arch_dir = srv_add_path_separator_if_needed(srv_arch_dir); srv_arch_dir = srv_add_path_separator_if_needed(srv_arch_dir);
......
...@@ -340,7 +340,6 @@ trx_sys_doublewrite_restore_corrupt_pages(void) ...@@ -340,7 +340,6 @@ trx_sys_doublewrite_restore_corrupt_pages(void)
/* It is an unwritten doublewrite buffer page: /* It is an unwritten doublewrite buffer page:
do nothing */ do nothing */
} else { } else {
/* Read in the actual page from the data files */ /* Read in the actual page from the data files */
...@@ -357,9 +356,19 @@ trx_sys_doublewrite_restore_corrupt_pages(void) ...@@ -357,9 +356,19 @@ trx_sys_doublewrite_restore_corrupt_pages(void)
"InnoDB: Trying to recover it from the doublewrite buffer.\n"); "InnoDB: Trying to recover it from the doublewrite buffer.\n");
if (buf_page_is_corrupted(page)) { if (buf_page_is_corrupted(page)) {
fprintf(stderr,
"InnoDB: Dump of the page:\n");
buf_page_print(read_buf);
fprintf(stderr,
"InnoDB: Dump of corresponding page in doublewrite buffer:\n");
buf_page_print(page);
fprintf(stderr, fprintf(stderr,
"InnoDB: Also the page in the doublewrite buffer is corrupt.\n" "InnoDB: Also the page in the doublewrite buffer is corrupt.\n"
"InnoDB: Cannot continue operation.\n"); "InnoDB: Cannot continue operation.\n"
"InnoDB: You can try to recover the database with the my.cnf\n"
"InnoDB: option:\n"
"InnoDB: set-variable=innodb_force_recovery=6\n");
exit(1); exit(1);
} }
......
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