MySQL で innodb_force_recovery

Panhead

2017年01月26日 18:34

今日は後回しにしていたたMySQLの復旧を行いました。以下のメッセージから調査した所 innodb_force_recovery 値を設定することで復旧ができる可能性があることを見つけたのでどのレベルで復旧できるか試してみました。
170126 17:55:26  InnoDB: Assertion failure in thread 3796 in file fut0lst.ic line 83
InnoDB: Failing assertion: addr.page == FIL_NULL || addr.boffset >= FIL_PAGE_DATA
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.
170126 17:55:26 - mysqld got exception 0xc0000005 ;
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=16777216
read_buffer_size=262144
max_used_connections=1
max_threads=151
thread_count=1
connection_count=1
It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 133447 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x37191b0
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...
003568DE    mysqld.exe!my_osmaperr()
00356C2A    mysqld.exe!my_osmaperr()
003572F3    mysqld.exe!my_osmaperr()
002E6E63    mysqld.exe!my_osmaperr()
0034F233    mysqld.exe!my_osmaperr()
002F5D15    mysqld.exe!my_osmaperr()
00426C94    mysqld.exe!my_mb_ctype_mb()
00413858    mysqld.exe!my_mb_ctype_mb()
まずは innodb_force_recovery=1 。・・・
無事復旧。
まだまだ障害レベルとしては甘かった・・・あっけなく復旧できてしまいました。レベルとしては 1 ~ 6 までの 6 段階あり、障害規模に応じてレベルを変えていく、そのかわり復旧できる部分は減っていくという感じです。無事に復旧できて良かった。

関連記事