Bug #80253 InnoDB still corrupted with recovery set to 6
Submitted: 3 Feb 2016 13:36 Modified: 15 Jul 2016 13:57
Reporter: Cemen Kelsingra Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: InnoDB storage engine Severity:S2 (Serious)
Version: OS:Any
Assigned to: CPU Architecture:Any

[3 Feb 2016 13:36] Cemen Kelsingra
160202 16:54:21  InnoDB: Waiting for the background threads to start
160202 16:54:22 InnoDB: 5.5.37 started; log sequence number 0
160202 16:54:22 InnoDB: !!! innodb_force_recovery is set to 6 !!!
160202 16:54:22 [Note] Server hostname (bind-address): ''; port: 3306
160202 16:54:22 [Note]   - '' resolves to '';
160202 16:54:22 [Note] Server socket created on IP: ''.
160202 16:54:22 [Note] Event Scheduler: Loaded 0 events
160202 16:54:22 [Note] mysqld: ready for connections.
Version: '5.5.37-0ubuntu0.12.10.1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Ubuntu)
InnoDB: A new raw disk partition was initialized or
InnoDB: innodb_force_recovery is on: we do not allow
InnoDB: database modifications by the user. Shut down
InnoDB: mysqld and edit my.cnf so that newraw is replaced
InnoDB: with raw, and innodb_force_... is removed.
160202 16:54:31  InnoDB: Assertion failure in thread 140187534427904 in file row0sel.c line 2361
InnoDB: Failing assertion: field->col->mtype == type
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.5/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
15:54:31 UTC - mysqld got signal 6 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed, 
something is definitely wrong and this may fail.

It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 3314053 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x7f7ffa7cae50
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 7f7ff430fe60 thread_stack 0x30000

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (7f7fb0004b70): is an invalid pointer
Connection ID (thread ID): 10

How to repeat:
I have no idea
[9 Feb 2016 14:56] Cemen Kelsingra
The database is used for a Wordpress website.

I managed to have some seconds of uptime when I started mysql. On the dump tries, it seemed that the dump always stopped on getting into wp_options table.

It is an innoDB table, so very likely she is the corrupted one.
I am unable to repair it, I tried to dump it and reload it... without any success
[10 Feb 2016 11:29] Cemen Kelsingra
OK I finally managed to solve the problem. The last error I had (ERROR 1030 (HY000)) was caused by the fact that innodb_force_recovery was still set.

Here are the steps I did :

-During a (small) uptime, go to phpmyadmin, and try a full export
-Inspect the sql file obtained, and check if it stops during the export (mine was stopping when managing data from a wp_option table. Maybe it was corrupted)
-Delete all wp-session elements from wp_option table
-At this step, the db was still crashing, even after a reboot
-Export all data from the crashing DB
-Delete the DB
-Recreate it with the same name, and import all exported data

Worked for me, now 3 hours uptime, no crash.
[15 Jul 2016 13:57] MySQL Verification Team
Thank you for the report and confirmation that your issue is solved.
Also, see Bug #71420. Anything beyond 3 can permanently corrupt the database
4 can corrupt secondary indexes 5 can cause inconsistent results, also corrupt sec indexes (even if 4 did not have any effect)