[mythtv-users] Myth is now recording when I exit Live TV

mythtv mythtv at mdabbs.org
Tue Jul 19 17:06:20 UTC 2016



On 07/19/2016 09:35 AM, Mark Perkins wrote:
> On 19 July 2016 9:16:18 PM ACST, mythtv <mythtv at mdabbs.org> wrote:
>> Sorry guys, yes it is a deliberate replication strategy.  I apologize
>> for the wasted time and effort, but I'm not sorry that the issue was
>> brought to light so conversation can be had on how to resolve it (if at
>> all).  I'll make a change to the recordinginfo.h file to match my
>> database and see if that helps with my auto-recording of livetv issue
>> that I'm seeing.
>> _______________________________________________
> Genuine question from idle curiosity. Not knowing the ins-and-outs of database replication does the recgroupid being an identifier rather than an index break your replication? Ie i assume that the secondary master (or whatever correct term is) will have a recgroupid of 2 for default, 4 for LiveTV etc (ie the even numbers), yet the recorded table will use the values from the primary master ie 1,3,5 etc the odd numbers?
>
>
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://lists.mythtv.org/mailman/listinfo/mythtv-users
> http://wiki.mythtv.org/Mailing_List_etiquette
> MythTV Forums: https://forum.mythtv.org
In my setup, I use a master-master replication scheme which requires the
auto-increment and auto-offset to be changed.  auto-increment is 2 and
the offset is either 1 or 2 depending on the server.  But to answer your
question, the secondary master will match the primary, it has to or it
is not a replication.  The issue comes down to, on which server did the
insert get executed.  It only gets executed on one, then replicated to
the other.  So both servers in this case are 1, 3, 5,  7 because my
primary master's offset is 1.  Had I run the insert on the secondary
master, they would have been 2, 4, 6, 8.

So, with it being an autoincrement column, and the code assuming an
autoincrement of 1 is what caused the problem.  There are methods for
querying the auto-increment values from mysql if that was an approach to
take.  I believe you can also supply the ID during insert and mysql
should be ok with that.  That way you can specify your magic numbers but
still allow for new recgroups to increment naturally.  Another method
might be to use LIMIT and OFFSET on the select, assuming the records are
inserted in the same order.  Then LIMIT 1,1 would give you the second
recgroup, regardless of its ID.

There are a lot of good howtos on master-master setups.  There are some
disadvantages but for me, its HA with a pinch of a backup feature mixed in.

By the way, editing recordinginfo.h to match the DB fixed the issue of
the auto-recording problem.  I'd offer to fix the code to use the LIMIT
feature since I think that's the quickest, least obtrusive method if
someone wants to point me to some source files.  I've tried to load up
mythtv into Eclipse in the past and it's a monster to get involved in. 
I'm not a Qt developer so the framework always gets in my way.


More information about the mythtv-users mailing list