So what happens when mysqld runs out of disk space?
The answer is: It depends
- It might start to wait until disk space becomes available.
- It might crash intentionally after a 'long semaphore wait'
- It might return an error to the client (e.g. 'table full')
- It might skip writing to the binlog (see
binlog_error_action
)
Fixing the disk space issue can be done by adding more space or cleaning up some space. The later can often be done without help of the administrator of the system.
So I wanted to change the behaviour so that it MySQL wouldn't crash or stop to respond to read queries. And to also make it possible for a user of the system to cleanup data to get back to a normal state.
So I wrote a audit plugin which does this:
- The DBA sets the maxdiskusage_minfree variable to a threshold for the minimum amount of MB free.
- If the amount of free disk space goes under this threshold:
- Allow everything for users with the SUPER privilege
- Allow SELECT and DELETE
- Disallow INSERT
- If the amount of free space goes back to normal: Allow everything again
Note that DELETE can actually increase disk usage because of binlogs, undo, etc.
The code is available on github: https://github.com/dveeden/mysql_maxdiskusage
The King Casino Review 2021 - Casino Bonus
ReplyDeleteYou have 더킹카지노 the opportunity to win hundreds matchpoint of thousands of dollars 10cric every year by playing the slots on a daily basis, and we've got our hands on all of the
What an awesome post. Thanks for sharing! Demolition Tampa FL
ReplyDelete