Details
-
Bug
-
Status: Closed (View Workflow)
-
Blocker
-
Resolution: Fixed
-
10.6.12, 10.6.13, 10.6.14, 10.7(EOL), 10.8(EOL), 10.9(EOL), 10.10(EOL), 10.11, 11.0(EOL), 11.1(EOL), 11.2(EOL)
Description
This was reproduced while trying to reproduce an older issue MDEV-30531.
Some InnoDB B-tree cursor refactoring in MDEV-30400 turns out to be unsafe, resulting in InnoDB tables being flagged as corrupted. This occurs also on PRIMARY KEY indexes (clustered indexes), not only on secondary index pages.
The root cause seems to be that some operations are accessing the buffer page frame contents while only holding a buffer-fix on the page, not a page latch. It could be the case that the page is being read into the buffer pool, or it is being decrypted or decompressed. In some core dumps of such failures (with additional instrumentation to essentially revert MDEV-13542), the corruption condition would no longer hold.
Attachments
Issue Links
- blocks
-
MDEV-30531 Corrupt index(es) on busy table when using FOREIGN KEY with CASCADE or SET NULL
-
- Closed
-
- is caused by
-
MDEV-30400 Assertion `height == btr_page_get_level(page_cur_get_page(page_cursor))' failed in btr_cur_search_to_nth_level on INSERT
-
- Closed
-
- relates to
-
MDEV-13542 Crashing on a corrupted page is unhelpful
-
- Closed
-
-
MDEV-27058 Buffer page descriptors are too large
-
- Closed
-
-
MDEV-32116 Server suddenly crashed
-
- Closed
-
-
MDEV-33764 InnoDB: Failing assertion: err == DB_SUCCESS in btr0cur.cc line 4272
-
- Open
-
-
MDEV-33205 [ERROR] InnoDB: We detected index corruption in an InnoDB type table.
-
- Closed
-
This bug had been reproduced while trying to reproduce another issue
MDEV-30531. I am quoting the error log from this comment:2023-07-15 15:41:26 0 [Note] /test/MD220623-mariadb-11.1.2-linux-x86_64-opt/bin/mariadbd: ready for connections.
Version: '11.1.2-MariaDB' socket: '/test/MD220623-mariadb-11.1.2-linux-x86_64-opt/socket.sock' port: 12801 MariaDB Server
2023-07-15 15:41:38 1509 [Note] InnoDB: Number of transaction pools: 2
2023-07-15 16:19:46 72616 [ERROR] InnoDB: We detected index corruption in an InnoDB type table. You have to dump + drop + reimport the table or, in a case of widespread corruption, dump all InnoDB tables and recreate the whole tablespace. If the mariadbd server crashes after the startup or when you dump the tables. Please refer to https://mariadb.com/kb/en/library/innodb-recovery-modes/ for information about forcing recovery.
2023-07-15 16:19:46 72616 [ERROR] mariadbd: Index for table 't2' is corrupt; try to repair it
This bug was a race condition that would allow a being-read page to be accessed before it had been fully read or uncompressed. As a result, the table may be claimed to be corrupted, even though it is not.