Bug #3129 possible bug? mysql_embedded, no disk space behaviour
Submitted: 10 Mar 2004 2:59 Modified: 11 Mar 2004 10:14
Reporter: [ name withheld ] Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Embedded Library ( libmysqld ) Severity:S1 (Critical)
Version:4.0.16 OS:Linux (linux, 2.4)
Assigned to: Michael Widenius CPU Architecture:Any

[10 Mar 2004 2:59] [ name withheld ]
Description:
I've been playing with mysql_embdedded again and noticed behaviour that might not be correct?
I ran it overnight and filled a table with random data.
I came back this morning and found my program crashed after 1.4mil entries.

Disk ran full.
I see that no extra threads are running anymore (ps shows none anymore) when i do an strace on the program it shows a nansleep of 60 seconds, after that
it tries to pwrite() 57 bytes.
pwrite returns -1 (ENOSPC = No space left on device).
This is an endless loop (i watched it for 4 hours now, and it allways tries to write the same 57 bytes to disk).

It completely blocks my program and has to be killed manual.

Is this a bug or something known?
Do i have to statfs and check diskspace before insert?
And i also wonder why the threads all vanished.

How to repeat:
Write a tool that inserts 2000000 lines into a table and fill disk during insertation.
[11 Mar 2004 10:14] Michael Widenius
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.mysql.com/documentation/ and the instructions on
how to report a bug at http://bugs.mysql.com/how-to-report.php

Additional info:

On disk fill, mysqld will sleep for 60 seconds and then retry the write.
To continue, just free some space on the disk.

This is documented in the MySQL manual, in section: "How MySQL Handles a Full Disk"
[12 Mar 2004 4:24] [ name withheld ]
Hi,
Ok it might wait for free space that's allright.
But my program was locked and not recoverable, is this really wanted for the embedded lib?

(i currently check the disk status before doing an insert, because if disk is full the whole program could get locked again, so it's not able to even report the problem)