Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have xen virtual machine (Debian stable in PV mode) and I've Joomla on it. Several times in a day I see this message on the front page of my site.

jtablesession::Store Failed
DB function failed with error number 144
Table './database@002enet/hfd_session' is marked as crashed and last (automatic?) repair failed SQL=INSERT INTO `hfd_session` 
( `session_id`,`time`,`username`,`gid`,`guest`,`client_id` ) VALUES ( 'iae9qhmfhst464v4d0a6ho6nt3','1330628728','','0','1','0' )

I can't find the reason why it is crashing.

mysql.log and mysql.err log are clear. There are only some records in the mysql slow log, but they seem not be connected with this table. It is only this table that is crashing.

I tried to drop this table and to create it again, to restart system and to check disk with fsck (there was no error). But I still encounter this crash And I need to fix it manually every time I see it.

Is there any way to fix this issue?

 $ dpkg -l | grep mysql
ii  libdbd-mysql-perl                       4.016-1                         Perl5 database interface to the MySQL database
ii  libmysqlclient16                        5.1.49-3                        MySQL database client library
ii  mysql-client-5.1                        5.1.49-3                        MySQL database client binaries
ii  mysql-common                            5.1.49-3                        MySQL database common files, e.g. /etc/mysql/my.cnf
ii  mysql-server                            5.1.49-3                        MySQL database server (metapackage depending on the latest version)
ii  mysql-server-5.1                        5.1.49-3                        MySQL database server binaries and system database setup
ii  mysql-server-core-5.1                   5.1.49-3                        MySQL database server binaries
ii  php5-mysql                              5.3.3-7+squeeze3                MySQL module for php5
share|improve this question
    
Duplicate over at ServerFault –  Bobby Mar 1 '12 at 19:31
    
It's not a duplicate of question on your link. I know how to fix crashed table. In my case this crash appears several times per day and this is the problem, cause I need to monitor my site and fix this problem every time it appears. I want to find the reason why it go this way and to fix the reason. –  rush Mar 1 '12 at 20:34
    
Huh...I skipped that several times a day while reading. oÓ ... Erm, what I'd try is to do bulk inserts into that table, and see if that corrupts it at any point without interaction from Joomla if possible. If that corrupts the table, try to reproduce that, maybe you can pinpoint it that way. –  Bobby Mar 1 '12 at 21:02

2 Answers 2

up vote 1 down vote accepted

We deal with crashed mysql tables quite a bit so few suggestions on things to try.

Firstly, try dropping the table, restarting mysql, then re-adding the table. This will let it fully recreate the table and fix any latent structure errors. Alternatively a repair table followed by flush_tables can work but we've found it doesn't have as high a success rate.

If that doesn't work, try moving the table to a completely in memory table. Switch in from InnoDB or MyISM to MEMORY and see if it still crashes. Be warned that this table will not maintain results across restarts but since it is a session table, it shouldn't impact you. Reason this works is that slower disks will large queries like to corrupt tables when system/database checkpoints occur. I've yet to see a full correlation on this but in every case, faster servers don't error anywhere close to the number of times our slower ones do. Given that this is a VM, disk slowness is likely to be an issue at times.

Last thing is to enable full mysql query logs. This WILL impact performance so be careful. Idea here is to track down which query last succeeds and which fails. If you catch enough failures you'll get to the point where you see a pattern. If you can reliably re-produce the crash, you've gotten yourself a MySQL bug. Hopefully you don't reach this point :)

share|improve this answer
repair table [name of crashed table]
share|improve this answer
2  
Please, read my question properly. I didn't ask for help in repairing crashed table. I was needing to figure out the reason of crashes. –  rush Oct 18 '12 at 10:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.