How to avoid mysql query hang if the disk is full

The disk is full and my query hangs on the mysql query.

From the mysql manual:

When a disk-full condition occurs, MySQL does the following:

It checks once every minute to see whether there is enough space to write the current row. If there is enough space, it continues as if nothing had happened.

Every 10 minutes it writes an entry to the log file, warning about the disk-full condition.

Is there any option to change the behavior? I need it return if it finds the disk is full.

Answer

There is no such option in Mysql.

If Mysql needs to write to disk and has no space available it cannot write anything, that’s it.

If you have disk space issues, your best bet would be to monitor your disk space usage using a dedicated monitoring tool.
When an alert is raised, solve it before it affects Mysql functionnalities.

Try to identify what is causing this space overload and solve it.
At very least, consider adding more disk.

A disk full problem is never what a system admin (nor DBA) wants !

Attribution
Source : Link , Question Author : jaslip , Answer Author : krisFR

Leave a Comment