Mysql – Debugging error report percona 5.6

myisamMySQLpercona

I'm running percona 5.6 on a new centos 6.4 server. Things seem to work OK. I personally only really use InnoDB tables for my databases, but only the standard 'mysql' table is in MyISAM format.

I checked the msyql-error.log and saw these messages:

2013-11-14 10:10:26 9013 [ERROR] /usr/sbin/mysqld: Incorrect key file for table '/tmp/#sql_2335_0.MYI'; try to repair it
2013-11-14 10:10:26 9013 [ERROR] Got an error from unknown thread, /mnt/workspace/percona-server-5.6-rpms/label_exp/centos6-64/target/BUILD/Percona-Server-5.6.14-rel62.0/storage/myisam/mi_write.c:226
2013-11-14 10:10:27 9013 [ERROR] /usr/sbin/mysqld: Incorrect key file for table '/tmp/#sql_2335_2.MYI'; try to repair it
2013-11-14 10:10:27 9013 [ERROR] Got an error from unknown thread, /mnt/workspace/percona-server-5.6-rpms/label_exp/centos6-64/target/BUILD/Percona-Server-5.6.14-rel62.0/storage/myisam/mi_write.c:226
2013-11-14 13:53:33 9013 [ERROR] /usr/sbin/mysqld: Incorrect key file for table '/tmp/#sql_2335_0.MYI'; try to repair it
2013-11-14 13:53:33 9013 [ERROR] Got an error from unknown thread, /mnt/workspace/percona-server-5.6-rpms/label_exp/centos6-64/target/BUILD/Percona-Server-5.6.14-rel62.0/storage/myisam/mi_write.c:226
2013-11-14 15:51:54 9013 [ERROR] /usr/sbin/mysqld: Incorrect key file for table '/tmp/#sql_2335_0.MYI'; try to repair it
2013-11-14 15:51:54 9013 [ERROR] Got an error from unknown thread, /mnt/workspace/percona-server-5.6-rpms/label_exp/centos6-64/target/BUILD/Percona-Server-5.6.14-rel62.0/storage/myisam/mi_write.c:226
2013-11-14 19:39:09 9013 [ERROR] /usr/sbin/mysqld: Incorrect key file for table '/tmp/#sql_2335_0.MYI'; try to repair it
2013-11-14 19:39:09 9013 [ERROR] Got an error from unknown thread, /mnt/workspace/percona-server-5.6-rpms/label_exp/centos6-64/target/BUILD/Percona-Server-5.6.14-rel62.0/storage/myisam/mi_write.c:226
2013-11-15 00:18:24 9013 [ERROR] /usr/sbin/mysqld: Incorrect key file for table '/tmp/#sql_2335_0.MYI'; try to repair it
2013-11-15 00:18:24 9013 [ERROR] Got an error from unknown thread, /mnt/workspace/percona-server-5.6-rpms/label_exp/centos6-64/target/BUILD/Percona-Server-5.6.14-rel62.0/storage/myisam/mi_write.c:226

This seems to be relating MyISAM tables, which is then the 'mysql' information table.

Any idea what might be causing this?

I checked the /tmp dir, and it has plenty of space available.

Best Answer

Actually, your problem comes from temporary tables, that may be created in MyISAM format (in fact, up to 5.5, this was the only format for temporary tables on disk), not from the system tables in the mysql database, that are mostly also in MyISAM format.

This may be caused by a new feature of 5.6, where subquery execution may generate indexes for faster processing.

By experience, do not trust what a simple filesystem inspection may tell you about available free space- in particular with files that are deleted very often, but they have still a file descriptor open.

There are many things that you could check here: temporary files created by your processes, integrity of your /tmp filesystem partition, if you have recently mounted/unmounted that partition, trying to change your /tmpdir, etc. Unfortunately Percona Server 5.5 SHOW TEMPORARY TABLES is not available in 5.6 (yet?).