Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.5, 10.6, 10.2(EOL), 10.3(EOL), 10.4(EOL)
Description
InnoDB is not checking that the page number in a buffer pool page is correct. The following would implement such a check:
diff --git a/storage/innobase/mtr/mtr0mtr.cc b/storage/innobase/mtr/mtr0mtr.cc
|
--- a/storage/innobase/mtr/mtr0mtr.cc
|
+++ b/storage/innobase/mtr/mtr0mtr.cc
|
@@ -1196,6 +1196,8 @@ void mtr_t::page_lock(buf_block_t *block, ulint rw_latch)
|
#endif /* BTR_CUR_HASH_ADAPT */
|
|
done:
|
+ ut_ad(page_id_t(page_get_space_id(block->page.frame),
|
+ page_get_page_no(block->page.frame)) == block->page.id());
|
memo_push(block, fix_type);
|
}
|
|
This would be tripped in a number of tests that inject corruption to data files. Those tests will have to be adjusted.
Furthermore, operations like DROP TABLE need to be fixed so that they will not attempt to load the table definition at all. This would avoids a crash in a test that corrupts the clustered index root page number of a table. The following fix for that test would be needed in any case:
diff --git a/mysql-test/suite/innodb/t/page_id_innochecksum.test b/mysql-test/suite/innodb/t/page_id_innochecksum.test
|
index 2726b3254da..f5166018dd1 100644
|
--- a/mysql-test/suite/innodb/t/page_id_innochecksum.test
|
+++ b/mysql-test/suite/innodb/t/page_id_innochecksum.test
|
@@ -61,5 +61,9 @@ let SEARCH_PATTERN=page id mismatch;
|
--source include/search_pattern_in_file.inc
|
|
--remove_file $resultlog
|
+# prevent purge from crashing on page ID mismatch
|
+let $restart_parameters=--innodb-force-recovery=2;
|
--source include/start_mysqld.inc
|
drop table t1;
|
+let $restart_parameters=;
|
+--source include/restart_mysqld.inc |
Attachments
Issue Links
- relates to
-
MDEV-12434 Database page corruptions
- Closed
-
MDEV-26966 The parameter innodb_force_load_corrupted makes no sense
- Closed
-
MDEV-31347 fil_ibd_create() may hijack the file handle of an old file
- Closed