Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
5.5(EOL), 10.0(EOL), 10.1(EOL), 10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5
-
10.2.11
Description
If a page cannot be decrypted (or read) during crash recovery, InnoDB should cleanly abort the startup. If innodb_force_recovery is specified, we should ignore the problematic page and apply redo log to other pages.
If there is a MLOG_INIT_FILE_PAGE or MLOG_ZIP_PAGE_COMPRESS record for a corrupted page, we can always safely ignore the previous page contents and apply the redo log. There is no need to read a page from the data file when applying MLOG_INIT_FILE_PAGE or MLOG_ZIP_PAGE_COMPRESS.
Currently in 10.2, the test encryption.innodb-redo-badkey randomly fails, possibly because of this. Also, the test innodb.innodb_bug14147491 needs to be extended.
Attachments
Issue Links
- blocks
-
MDEV-19738 Doublewrite buffer is unnecessarily used for newly (re)initialized pages
-
- Closed
-
- causes
-
MDEV-20688 Recovery crashes after unnecessarily reading a corrupted page
-
- Closed
-
- is blocked by
-
MDEV-19241 InnoDB fails to write MLOG_INDEX_LOAD upon completing ALTER TABLE
-
- Closed
-
- is duplicated by
-
MDEV-12898 encryption.innodb-redo-badkey failed in buildbot, server hung on startup
-
- Closed
-
-
MDEV-14079 encryption.innodb-force-corrupt failed in buildbot
-
- Closed
-
- relates to
-
MDEV-12700 Allow innodb_read_only startup without prior slow shutdown
-
- Closed
-
-
MDEV-12750 Fix crash recovery of key rotation
-
- Closed
-
-
MDEV-15528 Avoid writing freed InnoDB pages
-
- Closed
-
-
MDEV-18976 Implement a CHECKSUM redo log record for improved validation
-
- Closed
-
-
MDEV-19541 InnoDB crashes when trying to recover a corrupted page
-
- Closed
-
-
MDEV-19586 Replace recv_sys_t::addr_hash with a std::map
-
- Closed
-
-
MDEV-19739 Avoid unnecessary page reads on recovery with innodb_log_optimize_ddl=ON
-
- Closed
-
-
MDEV-20755 InnoDB: Database page corruption on disk or a failed file read of tablespace upon prepare of mariabackup incremental backup
-
- Closed
-
-
MDEV-21572 buf_page_get_gen() should apply buffered page initialized redo log during recovery
-
- Closed
-
-
MDEV-23971 add the ability to fix corrupted pages on --prepare
-
- Closed
-
-
MDEV-10217 innodb.innodb_bug59641 fails sporadically in buildbot: InnoDB: Failing assertion: current_rec != insert_rec in file page0cur.c line 1052
-
- Closed
-
-
MDEV-11125 Introduce a reduced doublewrite mode, handling error detection only
-
- Closed
-
-
MDEV-11808 innodb.innodb_bug14147491 failed in buildbot
-
- Closed
-
-
MDEV-12253 Buffer pool blocks are accessed after they have been freed
-
- Closed
-
-
MDEV-12353 Efficient InnoDB redo log record format
-
- Closed
-
-
MDEV-12627 innodb.innodb_bug14147491 does not do proper cleanup
-
- Closed
-
-
MDEV-13823 innodb.log_data_file_size fails on buildbot with warnings intermittently
-
- Closed
-
-
MDEV-13872 innodb.innodb-64k-crash failed in buildbot with error on startup and SIGSEGV
-
- Closed
-
-
MDEV-13893 encryption.innodb-redo-badkey failed in buildbot with page cannot be decrypted
-
- Closed
-
-
MDEV-14425 Change the InnoDB redo log format to reduce write amplification
-
- Closed
-
-
MDEV-14481 Execute InnoDB crash recovery in the background
-
- Closed
-
-
MDEV-16941 innodb_gis.kill_server failed in buildbot with checksum mismatch in datafile
-
- Closed
-
-
MDEV-19335 Removal of encrypted from buf_page_t
-
- Closed
-
-
MDEV-19374 innodb.table_flags failed in buildbot with Server failed to restart
-
- Closed
-
On a related note, if there is unencrypted redo log for an encrypted page, and encryption has not been set up, the crash recovery will hang. This can be demonstrated by modifying a test (tested in 10.2 and 10.3):
diff --git a/mysql-test/suite/encryption/t/innodb_encrypt_log.test b/mysql-test/suite/encryption/t/innodb_encrypt_log.test
index 4bc556ee1d2..7a7f3acf07a 100644
--- a/mysql-test/suite/encryption/t/innodb_encrypt_log.test
+++ b/mysql-test/suite/encryption/t/innodb_encrypt_log.test
@@ -88,7 +88,7 @@ INSERT INTO t0 VALUES(NULL, 5, 5, 'public', 'gossip');
-- let SEARCH_FILE=$MYSQLD_DATADIR/test/t0.ibd
-- source include/search_pattern_in_file.inc
---let $restart_parameters=
+--let $restart_parameters=--skip-innodb-encrypt-log --skip-file-key-management --skip-innodb-encrypt-tables
--source include/start_mysqld.inc
The startup will get stuck in recv_apply_hashed_log_recs(last_batch=true):
while (recv_sys->n_addrs != 0) {
bool abort = recv_sys->found_corrupt_log;
mutex_exit(&(recv_sys->mutex));
if (abort) {
return;
}
os_thread_sleep(500000);
mutex_enter(&(recv_sys->mutex));
}
The flag recv_sys->found_corrupt_fs holds here.
The correct course of action (in the I/O threads) would seem to be to remove the unreadable pages from recv_sys, so that recv_sys->n_addrs would eventually reach 0.
Additionally, if recv_sys->found_corrupt_fs was set and innodb_force_recovery=0 (the default) is in effect, InnoDB startup should be aborted.