[mythtv-users] mass deleting shows?

Jay R. Ashworth jra at baylink.com
Wed Oct 24 19:03:52 UTC 2007


On Wed, Oct 24, 2007 at 02:30:04PM -0400, Michael T. Dean wrote:
> > I presume it uses ftrunc in a loop to shorten the file and return
> > blocks to the free list, and *then* does the unlink?
> 
> Actually, it opens the file, unlinks the file, then begins truncating
> the file until it's smaller than the truncate size (the 4MiB I mentioned
> above), at which point it closes the file and the filesystem deletes it
> since no processes have it open.  This way, the file is already
> "deleted" in case anything happens to crash mythbackend (or the user
> kills mythbackend) or the system itself crashes (and the remainder of
> the file will be removed on journal recovery/fsck--likely when the
> system is booted).  If we waited to unlink the file, we could leave
> orphans (possibly taking up many, many GiB's of space).

Ok yeah; I made that mistake in a car once, too: lock the brakes, and
*then* spin the wheel.  Yeah, I hit him.  :-)

> To see how it works, shut down your mythbackend and notice how long it
> takes.  Then, restart mythbackend and go in and delete some extremely
> large file(s)--you can even artificially increase the size of one of
> your recordings with "dd if=/dev/zero ..." to really see how it works
> (if you're using ext3, you'll notice a difference with about 10GB or
> more), making sure you have slow deletes enabled.  Then, immediately
> shut down the backend.  The shutdown will take "forever" in comparison
> because at the point of shutting down the backend, the filesystem begins
> deleting the large file(s) (a "normal" fast delete, but limited by the
> speed of deletes on your filesystem).  Eventually, the file9s) will be
> deleted and the shutdown script will finish.

Happens our media is on XFS, so the deletes come back pretty much
immediately, anyway.  I don't *think* we have Slow Deletes on, though
Pam may have turned it on.

Cheers,
-- jra
-- 
Jay R. Ashworth                   Baylink                      jra at baylink.com
Designer                     The Things I Think                       RFC 2100
Ashworth & Associates     http://baylink.pitas.com                     '87 e24
St Petersburg FL USA      http://photo.imageinc.us             +1 727 647 1274


More information about the mythtv-users mailing list