Bug 10840 - MySQL fails some operations if tmpdir is running out of diskspace
: MySQL fails some operations if tmpdir is running out of diskspace
Status: CLOSED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Database
: 7.3.2
: All All
: P3 normal (vote)
: 7.3.3
Assigned To: Michael Herger
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-01-27 04:23 UTC by Michael Herger
Modified: 2009-06-17 09:36 UTC (History)
3 users (show)

See Also:
Category: ---


Attachments
set tmptdir in my.tt (1.09 KB, patch)
2009-01-27 04:23 UTC, Michael Herger
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Herger 2009-01-27 04:23:26 UTC
Created attachment 4712 [details]
set tmptdir in my.tt

There have been several reports about the scanner crashing at some point complaining about corrupted MySQL tables. Eg.
http://forums.slimdevices.com/showthread.php?t=51361

The issue seems to occur pretty often on some NAS devices (QNAP) where /tmp is on a small ramdisk or other small partition. MySQL is then running out of diskspace during some actions. According to a report in the German forum setting tmpdir to a larger partition resolved the issue for him.

I'd suggest we define tmpdir in my.tt to use our cache folder instead of leaving it to MySQL to determine the system's folder.
Comment 1 Michael Herger 2009-01-27 13:48:30 UTC
change 24779 - (7.3.3) move MySQL's tmpdir from default to our Cache folder. Some NAS devices run out of disk space due to small ram disk partition for /tmp.

Will need to be merged manually into 7.4
Comment 2 Marc Auslander 2009-01-28 09:57:43 UTC
See complaints in forum about this breaking mysql.  Conjecture (which looks right on my system) is that mysql is running under a different UID than squeezecenter, and doesn't have permission to write in cache.

In any case, IMHO you ought to point it at a mysqltmp directory in cache, not to cache itself.  And then its natural to make that directory worldwrite just as /tmp is.
Comment 3 Andy Grundman 2009-01-28 10:00:47 UTC
Doesn't MySQL run as the same squeezecenter user though?
Comment 4 Marc Auslander 2009-01-28 10:26:56 UTC
My bad - I misread the ps output.  The mysql started by squeeze does run under the squeezecenter uid on my debian etch system, and I haven't actually seen the problem that was reported.  Just was too quick to chime in.

Maybe the people having trouble are trying to use a server other than one started by squeeze?
Comment 5 Andy Grundman 2009-01-28 10:47:07 UTC
Well, using an external MySQL would not be affected by this change, it only affects the built-in MySQL's tmpdir.
Comment 6 Andy Grundman 2009-01-28 15:50:02 UTC
I reverted this change until we can figure out what's going on.
Comment 7 Michael Herger 2009-02-04 04:24:17 UTC
The problem here is that SC seems to be running the system's mysqld binary while still using its own instance on some systems. It doesn't just hook up to an already running mysqld. This seems to be leading to the crashes we've seen after this change.

But imho the question still remains open why it would fail to write temporary files in the same folder it successfully writes the DB.
Comment 8 Michael Herger 2009-02-06 05:55:00 UTC
Would the following simpler patch work?

Index: /Users/mh/Documents/workspace/7.3/server/MySQL/my.tt
===================================================================
--- /Users/mh/Documents/workspace/7.3/server/MySQL/my.tt	(revision 24759)
+++ /Users/mh/Documents/workspace/7.3/server/MySQL/my.tt	(working copy)
@@ -12,6 +12,7 @@
 
 basedir               = [% basedir %]
 datadir               = [% datadir %]
+tmpdir                = [% datadir %]
 language              = [% language %]
 port                  = [% port %]
 socket                = [% socket %]


datadir obviously is writable. Don't know how this could fail.
Comment 9 Andy Grundman 2009-02-06 06:03:29 UTC
Yeah let's just try it and see.
Comment 10 Michael Herger 2009-02-06 06:23:39 UTC
change 24912 - use tmpdir at the same location as datadir
Comment 11 Michael Herger 2009-02-10 12:27:32 UTC
Second try to mark this bug as fixed... positive feedback from QNAP/Synology users, and no negative reports by others.
Comment 12 James Richardson 2009-06-17 09:36:36 UTC
This bug has been fixed in the 7.3.3 release version of SqueezeCenter!

If you haven't already. please download the new version from http://www.logitechsqueezebox.com/support/download-squeezecenter.html 

If you are still experiencing this problem, feel free to reopen the bug with your new comments and we'll have another look.