Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.5, 10.6, 10.11, 11.4
Description
InnoDB crash recovery is suppressing error messages about FIL_PAGE_LSN being in the future (recv_lsn_checks_on) and instead implementing a partly duplicated logic (recv_max_page_lsn). At least ever since the recovery was refactored in MDEV-29911, we’d better always enable these checks.
Furthermore, InnoDB fails to treat a page as corrupted when it has a valid checksum but the FIL_PAGE_LSN is too large. This could lead to the database becoming increasingly more corrupted.
Attachments
Issue Links
- causes
-
MDEV-35618 Bogus assertion failure 'recv_sys.scanned_lsn < max_lsn + 32 * 512U' during recovery
-
- Closed
-
- is blocked by
-
MDEV-13542 Crashing on a corrupted page is unhelpful
-
- Closed
-
-
MDEV-29911 InnoDB recovery and mariadb-backup --prepare fail to report detailed progress
-
- Closed
-
-
MDEV-34802 Recovery fails to note some log corruption
-
- Closed
-
- relates to
-
MDEV-25909 Unnecessary calls to fil_ibd_load() slow down recovery
-
- Open
-
-
MDEV-34879 InnoDB fails to merge the change buffer to ROW_FORMAT=COMPRESSED tables
-
- Closed
-
-
MDEV-35226 InnoDB occasionally fails to recover a corrupted page from the doublewrite buffer
-
- Stalled
-
-
MDEV-35348 Missing FILE_CHECKPOINT(*) at * recovery
-
- Closed
-
-
MDEV-33670 Redo log overwritten/corrupted
-
- Closed
-
In a multi-batch recovery (typically, when innodb_buffer_pool_size is reduced between the time the server was killed and restarted, as in the test innodb.recovery_memory), we will start reading pages and applying log before the final LSN will be known. In this case, we will need to maintain something similar to recv_max_page_lsn so that at the end of the recovery, we can check if any page LSN was in the future.
A single-batch recovery would be fine with a straightforward strict check:
diff --git a/mysql-test/suite/innodb/t/recovery_memory.test b/mysql-test/suite/innodb/t/recovery_memory.test
index 06101377f10..dbebe7c3091 100644
--- a/mysql-test/suite/innodb/t/recovery_memory.test
+++ b/mysql-test/suite/innodb/t/recovery_memory.test
@@ -37,7 +37,7 @@ let $restart_parameters=--innodb_buffer_pool_size=5242880 --debug_dbug=+d,ibuf_i
}
if (!$have_debug) {
--echo SET DEBUG_DBUG="+d,ib_log_checkpoint_avoid_hard";
-let $restart_parameters=--innodb_buffer_pool_size=5242880;
+let $restart_parameters=--innodb_buffer_pool_size=15242880;
}
CREATE TABLE t1(f1 INT NOT NULL)ENGINE=InnoDB;