Ticket #10533 (closed Developer Task: Fixed)
Opened 14 months ago
Last modified 13 months ago
Optimize scheduler for duplicate checking and EIT updates
|Reported by:||gigem||Owned by:||gigem|
|Component:||MythTV - Scheduling||Version:||Unspecified|
This patch includes several scheduler changes. I'll detail all of them when I commit it. The two major ones are described below. Please note that a small schema update must be done by hand and there is also a protocol change that is not yet advertised. Be careful to not mix this test version with unpatched versions.
As noted, a small schema update is needed. To make that change, please run the following MySQL commands.
alter table recordmatch add column findid int not null default 0; alter table recordmatch add index (recordid, findid);
The first major change in this patch is the scheduler only rechecks matching programs for duplicates in recorded and oldrecorded if the status might have changed. Previously, the scheduler rechecked all matched programs every time it ran. Because checking the oldrecorded table can be expensive, this change should provide a big improvement.
The second major change is the scheduler can be told to rematch and recheck only a portion of the program table. This is intended for use with EIT where portions of the program table are updated frequently in an orderly manner. This change should provide a big improvement in those cases. Please note the EIT scanner has not been updated yet. I hope Daniel will be able to do that, but if he can't, I will try myself.
To test this patch, please run the following cases with and without the patch. Wehn doing so, please save the "Reschedule requested for" and "Scheduled <n> items in" log lines from the master mythbackend and send them to me.
Test 1. Run "mythutil --resched". This forces a complete reschedule. There shouldn't be any signifcant change between versions for this test.
Test 2. Go to the EPG in mythfrontend and choose a program not currently covered by a recording rule. Press R/RECORD to create a new kSingleRecord rule. After the scheduler runs and the EPG updates, press DELETE and then OK to delete the rule. There should be a nocicable change between versions for this test.
Test 3. Go to ViewScheduled? in mythfrontend and choose a program with a recurring rule that matches several programs and has many entries in oldrecorded. Press E/EDIT to bring up the schedule editor. Change the rule type, change it back and then press OK to "dirty" the rule and force an update. There should be a big change between versions for this test.
Test 4. Run "mythutil --event 'RESCHEDULE_RECORDINGS' --event 'MATCH 0 0 0 YYYY-MM-DDTHH:MM:SS'" and replace the date with the time 3 hours from the current time. This simulates a reschedule caused by EIT where anything in the next 3 hours might have changed. Please note this can't be run on the unpatched version as it is only supported the more coarse rescheduling covered by "mythutil --resched".
Test 5. Using mythutil, run other limited reschedules that might be requested by EIT. The full syntax of the MATCH reschedule request is "MATCH <recordid> <sourceid> <mplexid> <maxstartttime>". A non-zero value for <recordid>, <sourceid> or <mplexid> or a valid time for <maxstarttime> limits the reschedule to programs matching that criteria.