Bug #13156 myisam-recover rebuilds are hard to interrupt when necessary to restore service
Submitted: 13 Sep 2005 21:55 Modified: 14 Sep 2005 2:31
Reporter: James Day Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: MyISAM storage engine Severity:S4 (Feature request)
Version:4.1.14-pro-gpl-log OS:Linux (linux)
Assigned to: CPU Architecture:Any

[13 Sep 2005 21:55] James Day
Description:
When a MyISAM index is damaged by a power failure or similar nasty crash scenario the automatic rebuilds from the myisam-recover option are not readily interruptible. The server doesn't respond promptly to mysqladmin shutdown or kill -15 PID, leaving kill -9 PID the way to go if it is essential to abort the recovery to avoid say a repair which is known to take several hours. This allows the table to be renamed and replaced by a blank or partial table to restore partial service as soon as possible in a situation where high availability is essential.

How to repeat:
Turn off the power to a server while updating at a high rate or take other action to ensure MyISAM index corruption. Attempt to kill the repair or carry out other actions to rename the table while the repair is running. I'm not aware of any way to succeed short of killing the whole server, then renaming the direcory.

Suggested fix:
Possible options include having repair threads show up in SHOW PROCESSLIST and respond to KILLs delivered to them.

The main workaround is to use InnoDB tables.