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:
None 
Category:MySQL Server: InnoDB storage engine Severity:S2 (Serious)
Version: OS:Any
Assigned to: CPU Architecture:Any

[3 Feb 2016 13:36] Cemen Kelsingra
Description:
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): '127.0.0.1'; port: 3306
160202 16:54:22 [Note]   - '127.0.0.1' resolves to '127.0.0.1';
160202 16:54:22 [Note] Server socket created on IP: '127.0.0.1'.
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.

key_buffer_size=33554432
read_buffer_size=131072
max_used_connections=10
max_threads=1500
thread_count=10
connection_count=10
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
mysqld(my_print_stacktrace+0x29)[0x7f7ff94ec979]
mysqld(handle_fatal_signal+0x3d8)[0x7f7ff93d3f78]
/lib/x86_64-linux-gnu/libpthread.so.0(+0xfcb0)[0x7f7ff7f2ecb0]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x35)[0x7f7ff7596425]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x17b)[0x7f7ff7599b8b]
mysqld(+0x5bbc6d)[0x7f7ff9584c6d]
mysqld(+0x59f052)[0x7f7ff9568052]
mysqld(+0x4b789d)[0x7f7ff948089d]
mysqld(+0x4b7f7d)[0x7f7ff9480f7d]
mysqld(_ZN10SQL_SELECT17test_quick_selectEP3THD6BitmapILj64EEyyb+0x1c94)[0x7f7ff948da44]
mysqld(+0x34695f)[0x7f7ff930f95f]
mysqld(_ZN4JOIN8optimizeEv+0x52b)[0x7f7ff9312d0b]
mysqld(_Z12mysql_selectP3THDPPP4ItemP10TABLE_LISTjR4ListIS1_ES2_jP8st_orderSB_S2_SB_yP13select_resultP18st_select_lex_unitP13st_select_lex+0xcd)[0x7f7ff931546d]
mysqld(_Z13handle_selectP3THDP3LEXP13select_resultm+0x174)[0x7f7ff931b584]
mysqld(+0x30a914)[0x7f7ff92d3914]
mysqld(_Z21mysql_execute_commandP3THD+0x12c3)[0x7f7ff92da573]
mysqld(+0x314cae)[0x7f7ff92ddcae]
mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0x1824)[0x7f7ff92dfd34]
mysqld(_Z24do_handle_one_connectionP3THD+0x105)[0x7f7ff937ae95]
mysqld(handle_one_connection+0x50)[0x7f7ff937afb0]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x7e9a)[0x7f7ff7f26e9a]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7f7ff76543fd]

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
Status: NOT_KILLED

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] Umesh Shastry
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)