Opened 12 years ago

Closed 11 years ago

Last modified 11 years ago

#10704 closed Patch - Bug Fix (fixed)

Expired programs are not being deleted with master/slave backends.

Reported by: Ian Dall <ian@…> Owned by: stuartm
Priority: minor Milestone: 0.26.1
Component: MythTV - Housekeeper Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

When there are separate master and slave backends, recordings made on the slave are not deleted properly. They are moved to the "Deleted" recording group, but the files are not deleted and the database entries are not removed from the 'recorded' table.

Since this does not free up space, eventually all expirable programs end up in the "Deleted" group.

If the master backend is restarted the files are deleted and the database entries removed.

This appears to be introduced with commit f78f9992d754390fa42f109e5139b8eaf224d076

This appears to be because AutoExpire::SendDeleteMessages() records programs which have been moved to the "Deleted" group in deleted_set. Autoexpire::UpdateDontExpireSet() initialises dont_expire_set from deleted_set and AutoExpire::FillDBOrdered() skips programs in dont_expire_set when constructing expireList.

I can see what is wrong but it is harder to understand what is supposed to be happening and figure out the fix. This is not helped by some some variable and function names. dont_expire_set seems to be used to mean "don't delete" rather than "don't expire".

I THINK removing all references to deleted_set and initialising dont expire_set to the empty set would solve the problem.

This issue would be masked by what looks like another bug when there are no slave backends. If the recording hostname is the same as the master hostname, autoexpired programs are just deleted without first sticking them in the "Deleted' recording group.

Attachments (1)

deleted_set.patch (1.3 KB) - added by Ian Dall <ian@…> 12 years ago.
Patch to remove references to deleted_set and initialise dont_expire_set properly.

Download all attachments as: .zip

Change History (12)

Changed 12 years ago by Ian Dall <ian@…>

Attachment: deleted_set.patch added

Patch to remove references to deleted_set and initialise dont_expire_set properly.

comment:1 Changed 12 years ago by beirdo

Milestone: 0.26unknown

Removing improperly set milestone.

comment:2 Changed 11 years ago by Jason <jason-devel-mythtv@…>

This bug has been biting me as well. Is there any tracing, testing, etc. that I can do to help move this along?

comment:3 Changed 11 years ago by Ian Dall <ian@…>

For information, I have been running with this patch since I submitted it (over six months ago) with no problems.

comment:4 Changed 11 years ago by davescammell@…

biting me too, will try this patch and report.

comment:5 Changed 11 years ago by stuartm

Type: Bug Report - GeneralPatch - Bug Fix

If including patches with your tickets can you please set the ticket Type correctly? We can usually close tickets with patches faster but they will usually go overlooked unless they have been properly categorised.

comment:6 Changed 11 years ago by stuartm

Component: MythTV - GeneralMythTV - Housekeeper
Milestone: unknown0.26.1
Owner: set to sphery
Status: newassigned

comment:7 Changed 11 years ago by davescammell@…

Works for me. The patch only required about one line to be amended against MythTV Version : v0.26.0-36-g8c68560-dirty (26 fixes) and has only been done against the MBE but the SBE is now happily reporting:

mythbackend[29383]: I DeleteThread? mainserver.cpp:95 (delete_file_immediately) About to delete file: /m/video1/mythtv/9700_20121128074200.mpg & similar for the associated png file.

and seems to be keeping the disk from filling up now. Sorry that took so long to report on, I've had build issues on the MBE.

+1 on the patch.Thanks.dave

comment:8 Changed 11 years ago by stuartm

Owner: changed from sphery to stuartm
Status: assignedaccepted

comment:9 Changed 11 years ago by Ian Dall <ian@…>

Resolution: fixed
Status: acceptedclosed

In e150a19030a81e3c099eff76b280b886122529b1/mythtv:

Fix deletes on Slave backends. Remove references to deleted_set and
initialise dont_expire_set properly which conflicted with 'deleted'
recgroup behaviour since 0.25. Fixes #10704

Signed-off-by: Stuart Morgan <smorgan@…>

comment:10 Changed 11 years ago by Ian Dall <ian@…>

In 8a7892b1ca1ec307d32a78153b57e012a721e9d3/mythtv:

Fix deletes on Slave backends. Remove references to deleted_set and
initialise dont_expire_set properly which conflicted with 'deleted'
recgroup behaviour since 0.25. Fixes #10704

Signed-off-by: Stuart Morgan <smorgan@…>
(cherry picked from commit e150a19030a81e3c099eff76b280b886122529b1)

comment:11 Changed 11 years ago by Ian Dall <ian@…>

In e38e08fcfa8e23136f0effdd54cc91eb434efd67/mythtv:

Fix deletes on Slave backends. Remove references to deleted_set and
initialise dont_expire_set properly which conflicted with 'deleted'
recgroup behaviour since 0.25. Fixes #10704

Signed-off-by: Stuart Morgan <smorgan@…>
(cherry picked from commit e150a19030a81e3c099eff76b280b886122529b1)

Note: See TracTickets for help on using tickets.