[MDEV-26780] Tablespaces corrupt, MariaDB does not start Created: 2021-10-07  Updated: 2021-11-07  Resolved: 2021-11-07

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Affects Version/s: 10.5.11
Fix Version/s: N/A

Type: Bug Priority: Critical
Reporter: Iván Ávalos Assignee: Marko Mäkelä
Resolution: Incomplete Votes: 0
Labels: corruption, crash, innodb, need_feedback
Environment:

Debian GNU/Linux 11. Raspberry Pi 4.


Attachments: File mariadb-stacktrace.log    
Issue Links:
Relates
relates to MDEV-13542 Crashing on a corrupted page is unhel... Closed

 Description   

It was probably some power outage what caused the issue. I've tried forcing recovery by setting the `innodb_force_recovery` variable incrementally, and none of the recovery modes seemed to magically fix the problem. Using higher modes, at least MariaDB starts, but databases are corrupt and crash MariaDB as soon as I try to interact with them using the client. It's not like I had highly important data in my databases, but I think it's worth trying to fix, in case it happens again when I do have important data stored in it. I attached the systemd logs.



 Comments   
Comment by Marko Mäkelä [ 2021-10-07 ]

Unfortunately, the mariadb-stacktrace.log is useless for any analysis, because the addresses were resolved incorrectly. With a correctly resolved stack trace (possibly from a core dump), it would be possible to identify which type of a page was corrupted. With the available information, I cannot know if it was an undo log page or an index page, and therefore I cannot give suggestions how to recover the rest of the data.

There is no magic fix. The intended purpose of innodb_force_recovery is to allow you to dump the data. The option innodb_force_recovery=6 is the most dangerous one, because it will cause the redo log to be ignored altogether. Starting with 10.5 (thanks to MDEV-19514 removing the special meaning of innodb_force_recovery=4), it should be the only option that can corrupt the data further.

If you have a copy of the data directory as it was before attempting innodb_force_recovery=6, then I would suggest that you attempt to invoke the server in a debugger. Because it is crashing at startup, this should be fairly easy. See also https://mariadb.com/kb/en/how-to-produce-a-full-stack-trace-for-mysqld/ for some hints.

Generated at Thu Feb 08 09:47:53 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.