Skip to content

Commit cc5c0ed

Browse files
committed
MDEV-33156 Crash on innodb_buf_flush_list_now=ON and innodb_force_recovery=6
srv_start(): Move a read only mode startup tweak from innodb_init_params() to the correct location. Also if innodb_force_recovery=6 we will disable the doublewrite buffer, because InnoDB must run in read-only mode to prevent further corruption. This change only affects debug checks. Whenever srv_read_only_mode holds, the buf_pool.flush_list will be empty, that is, there will be no writes of persistent InnoDB data pages. Reviewed by: Thirunarayanan Balathandayuthapani
1 parent 3a3a4f0 commit cc5c0ed

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

mysql-test/suite/innodb/r/ibuf_not_empty.result

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ check table t1;
1212
Table Op Msg_type Msg_text
1313
test.t1 check Warning InnoDB: Index 'b' contains 990 entries, should be 1024.
1414
test.t1 check error Corrupt
15+
SET GLOBAL innodb_buf_flush_list_now=ON;
1516
# restart
1617
SET GLOBAL innodb_fast_shutdown=0;
1718
# restart

mysql-test/suite/innodb/t/ibuf_not_empty.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ EOF
7272

7373
--replace_regex /contains \d+ entries/contains 990 entries/
7474
check table t1;
75+
SET GLOBAL innodb_buf_flush_list_now=ON;
7576

7677
--source include/shutdown_mysqld.inc
7778

storage/innobase/handler/ha_innodb.cc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3893,11 +3893,6 @@ static int innodb_init_params()
38933893
}
38943894
#endif
38953895

3896-
if (srv_read_only_mode) {
3897-
ib::info() << "Started in read only mode";
3898-
srv_use_doublewrite_buf = FALSE;
3899-
}
3900-
39013896
#ifdef LINUX_NATIVE_AIO
39023897
#elif !defined _WIN32
39033898
/* Currently native AIO is supported only on windows and linux

storage/innobase/srv/srv0start.cc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,10 +1073,14 @@ dberr_t srv_start(bool create_new_db)
10731073
if (srv_force_recovery) {
10741074
ib::info() << "!!! innodb_force_recovery is set to "
10751075
<< srv_force_recovery << " !!!";
1076+
if (srv_force_recovery == SRV_FORCE_NO_LOG_REDO) {
1077+
srv_read_only_mode = true;
1078+
}
10761079
}
10771080

1078-
if (srv_force_recovery == SRV_FORCE_NO_LOG_REDO) {
1079-
srv_read_only_mode = true;
1081+
if (srv_read_only_mode) {
1082+
sql_print_information("InnoDB: Started in read only mode");
1083+
srv_use_doublewrite_buf = false;
10801084
}
10811085

10821086
high_level_read_only = srv_read_only_mode

0 commit comments

Comments
 (0)