MySQL Got error 134错误排查

现象

Discuz论坛一张表反复崩溃,导致帖子页无法打开,日志如下:

forum_threadaddviews修复后,mysql日志仍然在刷ERROR错误:

追查

通过MySQL错误日志,可以看到Got error 134在13年8月和15年7月集中爆发,符合论坛近期的表现

Got error 134的表,几乎都是 forum_forumrecommend

forum_threadaddviews表情况,也差不多是13年8月和15年7月比较集中

Got error 134

Even though the MyISAM table format is very reliable (all changes to a table made by an SQL statement are written before the statement returns), you can still get corrupted tables if any of the following events occur:

  • The mysqld process is killed in the middle of a write.
  • An unexpected computer shutdown occurs (for example, the computer is turned off).
  • Hardware failures.
  • You are using an external program (such as myisamchk ) to modify a table that is being modified by the server at the same time.
  • A software bug in the MySQL or MyISAM code.

Typical symptoms of a corrupt table are: You get the following error while selecting data from the table:

  • Incorrect key file for table: '...'. Try to repair it
  • Queries don't find rows in the table or return incomplete results.

来自:http://dev.mysql.com/doc/refman/5.0/en/corrupted-myisam-tables.html

解决:

修复

检查forum_forumrecommend,可以看到确实有错误

修复forum_forumrecommend

再次追查

看message,时间与上述问题比较吻合,因此可能是系统oom killer杀掉mysqld进程导致上述问题。

参考资料



本文遵从CC版权协定,转载请以链接形式注明出处。
本文链接地址: http://www.annhe.net/article-3439.html
  1. 所以解决办法是什么…我在 crontab 加了定时修复表的任务也没什么用,昨天又在 mysql 里加了个任务每天修复表…