<br><br><div><span class="gmail_quote">On 6/7/07, <b class="gmail_sendername">Stefan van der Eijk</b> &lt;<a href="mailto:stefan@eijk.nu">stefan@eijk.nu</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On 6/6/07, Michael T. Dean &lt;<a href="mailto:mtdean@thirdcontact.com">mtdean@thirdcontact.com</a>&gt; wrote:<br>&gt; On 06/06/2007 11:02 AM, Brett Kosinski wrote:<br>&gt; &gt;<br>&gt; &gt; On 6/6/07, Michael T. Dean &lt;
<a href="mailto:mtdean@thirdcontact.com">mtdean@thirdcontact.com</a>&gt; wrote:<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; On 06/06/2007 03:19 AM, Stefan van der Eijk wrote:<br>&gt; &gt;&gt;&gt;<br>&gt; &gt;&gt;&gt; I&#39;m also seeing that my disk is filling up, but it&#39;s not due to
<br>&gt; &gt;&gt;&gt; the mysql database. I think it&#39;s due to recorded programs that<br>&gt; &gt;&gt;&gt; have been deleted, but the mythbackend process is still holding<br>&gt; &gt;&gt;&gt; onto them:<br>&gt; &gt;&gt;&gt;
<br>&gt; &gt;&gt;&gt; # lsof | grep myth | grep deleted<br>&gt; &gt;&gt;&gt; mythbacke 23174&nbsp;&nbsp;&nbsp;&nbsp; mythtv 18r&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;REG&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;8,3<br>&gt; &gt;&gt;&gt; 2894512128&nbsp;&nbsp; 28181291<br>&gt; &gt;&gt;&gt; /var/lib/mythtv/recordings/1028_20070604212500.mpg (deleted)
<br>&gt; &gt;&gt;&gt;<br>&gt; &gt;&gt;&gt; Restarting the mythbackend process releases the diskspace.<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; So disable slow deletes.<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; Delete files slowly Some filesystems use a lot of resources when
<br>&gt; &gt;&gt; deleting large recording files.&nbsp;&nbsp;This option makes Myth delete the<br>&gt; &gt;&gt; file slowly on this backend to lessen the impact.<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; in mythtv-setup (on each backend).<br>
&gt; &gt;&gt;<br>&gt; &gt;<br>&gt; &gt; No, what he&#39;s describing, here, is something else.&nbsp;&nbsp;On any Unix<br>&gt; &gt; machine, if multiple processes have a file open, and someone comes<br>&gt; &gt; along and makes an unlink() call on that file, the file won&#39;t
<br>&gt; &gt; actually be deleted until all processes close their file handles.&nbsp;&nbsp;In<br>&gt; &gt; this case, mythbackend has opened the file,<br>&gt;<br>&gt; Right.<br>&gt;<br>&gt; &gt; for whatever reason,<br>&gt;<br>&gt; Perhaps because the user said to delete it and has slow deletes
<br>&gt; enabled.&nbsp;&nbsp;Slow deletes work by opening a file, unlinking that file, and<br>&gt; then truncating the file in small increments so as to prevent<br>&gt; filesystems that perform poorly on deleting large files from causing
<br>&gt; issues with recordings in progress due to I/O wait.&nbsp;&nbsp;Once the file is<br>&gt; smaller than the truncation increment, the file is closed (and, because<br>&gt; no other process has it open, deleted by the filesystem).
<br><br>Is it normal that this process hasn&#39;t completed 24 hrs after I deleted<br>the recording?<br><br>I still need to check if I have slow deletes enabled. I&#39;ll check and<br>do some testing over the weekend.</blockquote>
<div><br>I deleted a recording on Saturday evening, and it&#39;s still not gone yet:<br><br># lsof | grep recordings<br>mythbacke&nbsp; 5345&nbsp;&nbsp;&nbsp;&nbsp; mythtv&nbsp;&nbsp; 10w&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; REG&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 8,3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp; 28181221 /var/lib/mythtv/recordings/nfslockfile.lock
<br>mythbacke&nbsp; 5345&nbsp;&nbsp;&nbsp;&nbsp; mythtv&nbsp;&nbsp; 18r&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; REG&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 8,3 3086942208&nbsp;&nbsp; 28180992 /var/lib/mythtv/recordings/1030_20070517202500.mpg (deleted)<br><br>I don&#39;t have slow deletes enabled.<br>&nbsp;</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
&gt; &gt; and<br>&gt; &gt; has unlinked the file, but isn&#39;t closing it&#39;s currently opened file<br>&gt; &gt; handle,<br>&gt;<br>&gt; So that the filesystem doesn&#39;t try to delete it all in one fell swoop<br>&gt; that takes 5+ seconds and prevents writing a recording in progress to disk.
<br>&gt;<br>&gt; &gt; and so the filesystem can&#39;t actually free the underlying disk<br>&gt; &gt; space.&nbsp;&nbsp;If this is true, it seems like a pretty serious bug.<br>&gt;<br>&gt; Or, if the user doesn&#39;t want this behavior, a configuration issue.
<br>&gt;<br>&gt; I would bet that the OP thinks there may be issues with disk space<br>&gt; usage, so upon using lsof and seeing some files open but deleted, jumped<br>&gt; to the conclusion that this is the problem.&nbsp;&nbsp;I would guess, however,
<br>&gt; that in fact, the OP just has slow deletes enabled and that those files<br>&gt; will eventually be closed (and truly deleted) if the OP is patient<br>&gt; enough to wait for them to delete rather than just shutting down
<br>&gt; mythbackend to &quot;prove&quot; his theory.<br>&gt;<br>&gt; &gt; To the original poster, what version of mythbackend are you running?<br>&gt; &gt; What&#39;s your use case, here?&nbsp;&nbsp;Is there some sequence of operations
<br>&gt; &gt; which produces this behaviour 100% of the time?<br>&gt;<br>&gt; The first step in proving me wrong should be to disable slow deletes<br>&gt; (and, since that&#39;s a change in mythtv-setup, mythbackend should be shut
<br>&gt; down at the time) and then reproduce the behavior.&nbsp;&nbsp;At that point, we&#39;ll<br>&gt; know that any open deleted files are due to bugs.<br>&gt;<br>&gt; Mike<br>&gt;<br>&gt; FWIW, on my 3 backends:<br>&gt;<br>&gt; lsof -p `pidof mythbackend` | grep -i delete
<br>&gt;<br>&gt; gives no results.&nbsp;&nbsp;On each mythbackend has been up (running<br>&gt; continuously--I haven&#39;t shut it down) for 9 days.&nbsp;&nbsp;I&#39;ve watched and<br>&gt; deleted many recordings (at least 10) during that time.&nbsp;&nbsp;I do have slow
<br>&gt; deletes enabled, but all of the deletes have had time to complete.<br>&gt;<br>&gt;<br>&gt; _______________________________________________<br>&gt; mythtv-users mailing list<br>&gt; <a href="mailto:mythtv-users@mythtv.org">
mythtv-users@mythtv.org</a><br>&gt; <a href="http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users">http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users</a><br>&gt;<br></blockquote></div><br>