mariadb/mysql-test/suite/encryption/r
Marko Mäkelä 169c00994b MDEV-12699 Improve crash recovery of corrupted data pages
InnoDB crash recovery used to read every data page for which
redo log exists. This is unnecessary for those pages that are
initialized by the redo log. If a newly created page is corrupted,
recovery could unnecessarily fail. It would suffice to reinitialize
the page based on the redo log records.

To add insult to injury, InnoDB crash recovery could hang if it
encountered a corrupted page. We will fix also that problem.
InnoDB would normally refuse to start up if it encounters a
corrupted page on recovery, but that can be overridden by
setting innodb_force_recovery=1.

Data pages are completely initialized by the records
MLOG_INIT_FILE_PAGE2 and MLOG_ZIP_PAGE_COMPRESS.
MariaDB 10.4 additionally recognizes MLOG_INIT_FREE_PAGE,
which notifies that a page has been freed and its contents
can be discarded (filled with zeroes).

The record MLOG_INDEX_LOAD notifies that redo logging has
been re-enabled after being disabled. We can avoid loading
the page if all buffered redo log records predate the
MLOG_INDEX_LOAD record.

For the internal tables of FULLTEXT INDEX, no MLOG_INDEX_LOAD
records were written before commit aa3f7a107c.
Hence, we will skip these optimizations for tables whose
name starts with FTS_.

This is joint work with Thirunarayanan Balathandayuthapani.

fil_space_t::enable_lsn, file_name_t::enable_lsn: The LSN of the
latest recovered MLOG_INDEX_LOAD record for a tablespace.

mlog_init: Page initialization operations discovered during
redo log scanning. FIXME: This really belongs in recv_sys->addr_hash,
and should be removed in MDEV-19176.

recv_addr_state: Add the new state RECV_WILL_NOT_READ to
indicate that according to mlog_init, the page will be
initialized based on redo log record contents.

recv_add_to_hash_table(): Set the RECV_WILL_NOT_READ state
if appropriate. For now, we do not treat MLOG_ZIP_PAGE_COMPRESS
as page initialization. This works around bugs in the crash
recovery of ROW_FORMAT=COMPRESSED tables.

recv_mark_log_index_load(): Process a MLOG_INDEX_LOAD record
by resetting the state to RECV_NOT_PROCESSED and by updating
the fil_name_t::enable_lsn.

recv_init_crash_recovery_spaces(): Copy fil_name_t::enable_lsn
to fil_space_t::enable_lsn.

recv_recover_page(): Add the parameter init_lsn, to ignore
any log records that precede the page initialization.
Add DBUG output about skipped operations.

buf_page_create(): Initialize FIL_PAGE_LSN, so that
recv_recover_page() will not wrongly skip applying
the page-initialization record due to the field containing
some newer LSN as a leftover from a different page.
Do not invoke ibuf_merge_or_delete_for_page() during
crash recovery.

recv_apply_hashed_log_recs(): Remove some unnecessary lookups.
Note if a corrupted page was found during recovery.
After invoking buf_page_create(), do invoke
ibuf_merge_or_delete_for_page() via mlog_init.ibuf_merge()
in the last recovery batch.

ibuf_merge_or_delete_for_page(): Relax a debug assertion.

innobase_start_or_create_for_mysql(): Abort startup if
a corrupted page was found during recovery. Corrupted pages
will not be flagged if innodb_force_recovery is set.
However, the recv_sys->found_corrupt_fs flag can be set
regardless of innodb_force_recovery if file names are found
to be incorrect (for example, multiple files with the same
tablespace ID).
2019-04-17 13:58:41 +03:00
..
aria_tiny.result
corrupted_during_recovery.result MDEV-12699 Improve crash recovery of corrupted data pages 2019-04-17 13:58:41 +03:00
create_or_replace.result
debug_key_management.result
encrypt_and_grep.result MDEV-11984 Avoid accessing SYS_TABLESPACES unnecessarily 2018-03-22 18:01:29 +02:00
encryption_force.result Merge 10.1 into 10.2 2017-11-01 09:55:00 +02:00
filekeys_emptyfile.result
filekeys_encfile.result MDEV-14219 Allow online table rebuild when encryption or compression parameters change 2017-10-31 09:10:25 +02:00
filekeys_encfile_bad.result
filekeys_encfile_badfile.result
filekeys_encfile_file.result MDEV-14219 Allow online table rebuild when encryption or compression parameters change 2017-10-31 09:10:25 +02:00
filekeys_encfile_no.result
filekeys_nofile.result
filekeys_syntax.result
filekeys_tooshort.result
filekeys_unencfile.result
innochecksum.result
innodb-bad-key-change.result MDEV-18733 MariaDB slow start after crash recovery 2019-04-03 19:56:03 +03:00
innodb-bad-key-change2.result MDEV-18733 MariaDB slow start after crash recovery 2019-04-03 19:56:03 +03:00
innodb-bad-key-change3.result
innodb-bad-key-change4.result MDEV-18733 MariaDB slow start after crash recovery 2019-04-03 19:56:03 +03:00
innodb-checksum-algorithm,32k.rdiff MDEV-18601 Can't create table with ENCRYPTED=DEFAULT when innodb_default_encryption_key_id!=1 2019-02-28 23:20:31 +02:00
innodb-checksum-algorithm,64k.rdiff MDEV-18601 Can't create table with ENCRYPTED=DEFAULT when innodb_default_encryption_key_id!=1 2019-02-28 23:20:31 +02:00
innodb-checksum-algorithm.result Merge 10.1 into 10.2 2019-03-04 16:46:58 +02:00
innodb-compressed-blob.result MDEV-18733 MariaDB slow start after crash recovery 2019-04-03 19:56:03 +03:00
innodb-discard-import-change.result
innodb-discard-import.result MDEV-16416 Crash on IMPORT TABLESPACE of a ROW_FORMAT=COMPRESSED table 2018-06-07 10:34:32 +03:00
innodb-encr-threads.result
innodb-encryption-alter.result Merge 10.1 into 10.2 2019-03-04 16:46:58 +02:00
innodb-encryption-disable.result MDEV-18733 MariaDB slow start after crash recovery 2019-04-03 19:56:03 +03:00
innodb-first-page-read.result MDEV-13557: Startup failure, unable to decrypt ibdata1 2017-08-31 08:36:56 +03:00
innodb-force-corrupt.result MDEV-18733 MariaDB slow start after crash recovery 2019-04-03 19:56:03 +03:00
innodb-key-rotation-disable.result MDEV-13557: Startup failure, unable to decrypt ibdata1 2017-08-31 08:36:56 +03:00
innodb-missing-key.result MDEV-18733 MariaDB slow start after crash recovery 2019-04-03 19:56:03 +03:00
innodb-page_encryption-32k.result
innodb-page_encryption.result
innodb-page_encryption_compression.result
innodb-page_encryption_log_encryption.result
innodb-read-only.result
innodb-redo-badkey.result MDEV-13103: Improve 'cannot be decrypted' error message 2018-06-13 16:02:40 +03:00
innodb-redo-nokeys.result Merge branch '10.1' into 10.2 2018-06-21 23:47:39 +02:00
innodb-remove-encryption.result Merge branch '10.1' into 10.2 2018-04-10 17:43:18 +03:00
innodb-scrub-log.result
innodb-spatial-index.result cleanup: don't ---replace_regex /#sql-.*/#sql-temporary/ 2019-02-05 01:34:17 +01:00
innodb_encrypt_log.result Make a test more robust 2017-09-08 09:38:42 +03:00
innodb_encrypt_log_corruption.result MDEV-14909 MariaDB 10.2 refuses to start up after clean shutdown of MariaDB 10.3 2018-01-10 13:18:02 +02:00
innodb_encryption-page-compression.result MDEV-14814: encryption.innodb_encryption-page-compression failed in buildbot with timeout on wait condition 2018-02-24 22:39:21 +02:00
innodb_encryption.result MDEV-11984 Avoid accessing SYS_TABLESPACES unnecessarily 2018-03-22 18:01:29 +02:00
innodb_encryption_discard_import.result MDEV-12903: encryption.innodb_encryption_discard_import fails in buildbot with FOUND vs NOT FOUND 2018-04-12 08:39:19 +03:00
innodb_encryption_filekeys.result Merge 10.1 into 10.2 2018-02-17 14:54:12 +02:00
innodb_encryption_is.result
innodb_encryption_row_compressed.result
innodb_encryption_tables.result
innodb_first_page.result
innodb_lotoftables.result MDEV-11531: encryption.innodb_lotoftables failed in buildbot 2018-03-28 13:14:24 +03:00
innodb_onlinealter_encryption.result
innodb_page_encryption_key_change.result
innodb_scrub.result
innodb_scrub_background.result
second_plugin-12863.result MDEV-12863 No table can be created after second encryption plugin attempted to load 2017-08-08 14:52:08 +02:00
tempfiles.result Merge branch '10.1' into 10.2 2018-02-11 13:47:16 +01:00