[mythtv] [mythtv-commits] Ticket #2242: Recordings not being deleted fast enough

Martin Ebourne lists at ebourne.me.uk
Sat Aug 26 16:50:22 UTC 2006

On Sat, 26 Aug 2006 01:00:17 -0400, Michael T. Dean wrote:
> Also, if you really want to do a useful test of deletion, (enable 
> "Delete files slowly" if you update to r10947+ and then) please 
> uncomment the "Truncating '%1' to %2 MB" comment around line 1652 of 
> programs/mythbackend/mainserver.cpp before doing the delete.  If you 
> want help interpreting the log, feel free to send it to me (off-list--it 
> will be large), preferrably bzip'ed or gzip'ed.

Using updated svn and this time no recordings taking place:

At the start:
2006-08-26 17:07:00.195 AutoExpire: 1 file truncates are pending
2006-08-26 17:07:00.215 Truncating
 '/srv/media/recording//1012_20060804205900.mpg' by 4.16 MB every 500 milliseconds
2006-08-26 17:07:00.216 Truncating
 '/srv/media/recording//1012_20060804205900.mpg' to 13914.80 MB
2006-08-26 17:07:00.723 Truncating
 '/srv/media/recording//1012_20060804205900.mpg' to 13910.64 MB
2006-08-26 17:07:01.245 Truncating
 '/srv/media/recording//1012_20060804205900.mpg' to 13906.48 MB
2006-08-26 17:07:01.753 Truncating
 '/srv/media/recording//1012_20060804205900.mpg' to 13902.31 MB

At 17:09:57:

1K-blocks      Used Available Use% Mounted on
157224960 138640544  18584416  89% /srv/media/recording

2006-08-26 17:09:57.082 Truncating
 '/srv/media/recording//1012_20060804205900.mpg' to 12478.20 MB

At 17:24:55:

1K-blocks      Used Available Use% Mounted on
157224960 138640520  18584440  89% /srv/media/recording

2006-08-26 17:24:55.475 Truncating
 '/srv/media/recording//1012_20060804205900.mpg' to 5195.26 MB

Then I stopped mythbackend, which only had the one delete it was currently
truncating pending and the free space jumped up:

1K-blocks      Used Available Use% Mounted on
157224960 136858892  20366068  88% /srv/media/recording

One clue seems to be the nonsensical truncating size. It starts by
truncating the show to 13GB when it would have only been about 1.6-1.7GiB
in size (from looking at the other episodes of the same series recorded
off the same channel). This looks like a bytes/bits thing. It's
truncating to 1.70GiB if you do the conversion.

Sure the number goes down by "8 MB" every second, but if that's bits it's
only 1MiB/s which is not fast enough for the DVB recording rate which can
do that off one channel.

Clue number two is that the filesystem freespace is just not going up. I
can only guess that xfs is not returning free space to the pool when a
file is truncated! Maybe it keeps it there in case the file gets expanded
again. Maybe it only keeps it until the file is closed and then frees it
up. Who knows.

Killing mythbackend and forcing the file to be fully deleted freed up
1.70GiB which is really rather suspiciously like the whole file.

Maybe this needs to detect filesystem type and behave accordingly? Nasty.



More information about the mythtv-dev mailing list