Bug #115220 some assert should not been trigger when innodb_force_recovery is set
Submitted: 5 Jun 3:50 Modified: 5 Jun 5:02
Reporter: jia liu Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S4 (Feature request)
Version:8.0.35 OS:Any
Assigned to: CPU Architecture:Any
Tags: innodb_force_recovery

[5 Jun 3:50] jia liu
Description:
As the document says:

1 (SRV_FORCE_IGNORE_CORRUPT)

Lets the server run even if it detects a corrupt page. Tries to make SELECT * FROM tbl_name jump over corrupt index records and pages, which helps in dumping tables.

set innodb_force_recovery=1 should let innodb ignore corrupt pages.

But innodb always crash the server by some assert, which make it is very hard to dump data from an corrupted table.

How to repeat:
Create a large table with some data.

Corrupt the data file intentionally:
dd if=/dev/zero of=large.ibd conv=nocreat,notrunc bs=4K count=1 seek=1024

Restart mysql server, and read the table:
select id,sum(crc32(data)) from large;

The server will crash.

Change innodb_force_recovery=1, and restart the server.
Try dump the data of the table:
mysql -S /data/mysqldata/sock/mysql.sock db01 -q -e 'select * from large' >large

The server still crashes, with only a few data dumped.
[InnoDB] Assertion failure: buf0buf.cc:4054:ib::fatal

Suggested fix:
Asserts should take innodb_force_recovery into account.
[5 Jun 5:02] MySQL Verification Team
Hello!

Thank you for the feature request

regards,
Umesh