[mythtv-users] Recordings marked with "deletepending"

Greg Oliver oliver.greg at gmail.com
Sun Aug 3 14:32:13 UTC 2014


On Sun, Aug 3, 2014 at 9:04 AM, Michael T. Dean <mtdean at thirdcontact.com>
wrote:

> On 08/03/2014 09:43 AM, Greg Oliver wrote:
>
>> I rarely use mythweb, but this morning I was looking for a video I
>> archived so I fired it up.  One thing that caught my eye was that my
>> recordings showed a series that I knew I had deleted long, long ago.  This
>> (and a couple other) series do not show up in the frontends.
>>
>> Upon investigation, it was due to the "deletepending" column being set in
>> the recorded table.
>>
>
> These should never, ever show up in MythWeb (or mythfrontend).  If they
> are, there's a bug in MythWeb.  The only notice you should ever have of
> them is some amount of "Space used by deleted recordings" being reported
> all the time, even after you've permanently deleted your Deleted recordings.
>

Well, I guess I should be more clear - in mythweb, they showed up under the
"Show Recordings:" dropdown, so I played one, and sure enough the recording
was still there.  Bug or no bug, I am glad they showed up somewhere, or I
would have never seen it  :)


> Anyone know what would cause that?  These recordings were all from the
>> 2011/2012 timeframe, so it has been a while, but I am not sure why that
>> would be set (I am not sure what it even does to be honest).
>>
>> One nice thing - I got a free 1/2 TB of disk space back this morning :)
>>
>
> There's a race condition that occurs when you delete a huge number of
> shows and shut down mythbackend improperly (i.e. if you kill -KILL (or,
> even worse, if you kill it improperly with improper syntax, using kill
> -9)).  This usually happens because when you shut down mythbackend, even
> though it shuts down, it's still listed as a process until the file system
> finishes deleting all the shows that it had deleted.  Sometimes, users (or
> distro scripts?) get impatient and think mythbackend is hung or something
> and then use the nuclear option, which can leave some number of those
> just-deleted files in an intermediate/not-deleted state.  It's also
> possible that a power loss that occurs just after a huge delete could cause
> the problem (but, again, it's timing related and only will occur if the
> improper shutdown/power loss occurs right after a huge delete)
>


And this could very well be it.  When I decide finally that I no longer
need a series completely saved any more, I usually add the entire series to
the playlist, and then delete the playlist.  No telling if I had a power
outage or something odd way back then -


> This will only occur on some systems when you delete a very large amount
> of recording data (huge total file size compared to the speed at which your
> file system deletes large files--where it would take many 10's of seconds
> or minutes to finish deleting) and when you shut down mythbackend at the
> wrong time and in the wrong way.
>
> That said, the race condition will never occur if you enable slow deletes,
> so even if you don't need them, using slow deletes will prevent this
> problem from ever occurring.
>


Hmmm - I have had slow deletes on for as long as I can remember since I
have a lot of disk space, but maybe I was testing something and changed it
then before I had all of the space i have now.


> Also, messing with the deletepending flag in the database can cause
> serious problems with mythbackend if you don't do it properly--so I highly
> recommend people don't mess with it.  You shouldn't have many (if any)
> recordings in limbo unless you frequently shut down mythbackend incorrectly
> after deleting lots of recordings.
>


I just toggled the column and re-deleted them from the frontend - after
deletion, I verified they were indeed moved out of the recorded table.


> The find_orphans.py script needs to be modified to detect these and clean
> them up, and I think Raymond has done so, but I don't think the changes
> ever made it into the wiki version of the script.  Eventually, the master
> backend will take care of these automatically on restart, but I haven't
> finished making the changes.
>

Yes, I tried it first, and it indeed did not see them - it also still
claims that HLS transcodes are orphans in case there is a list of things
going for it..?  Oh well, I did not expect much from it since the wiki
states it only goes to .26

Thanks for all the info.

-Greg



> Mike
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://www.mythtv.org/mailman/listinfo/mythtv-users
> http://wiki.mythtv.org/Mailing_List_etiquette
> MythTV Forums: https://forum.mythtv.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mythtv.org/pipermail/mythtv-users/attachments/20140803/aef549e5/attachment.html>


More information about the mythtv-users mailing list