[mythtv-users] INSERT INTO recordedmarkup fails w/duplicate; recording status changes [Workaround]

Stephen Worthington stephen_agent at jsw.gen.nz
Sun Apr 16 02:47:25 UTC 2023


On Sat, 15 Apr 2023 15:29:11 -0700, you wrote:

>My experience seems to imply that the upgrade to maria 10.5.19, which
>happened on 3/11 according to my logs, did not take full effect until
>the system restarted on 4/4.  Which seems surprising, particularly
>since my recent downgrade became effective immediately.  For the
>recent downgrade I stopped, myth, the SQL sessions I had open, and
>maria before downgrading.  Maybe I missed some of those steps earlier
>(though I thought the packaging system itself stops maria before
>changing it). Perhaps myth checks maria version info when it starts,
>and I didn't restart myth?

Linux allows you to update a running file.  I think it does that by
pushing all the code in the running file into RAM and then (if
necessary) out into swap space before it overwrites the old file.  So
as long as the program using that file keeps running, it keeps using
the older version.  So if the MariaDB upgrade happened while MythTV
was still running, MythTV would have kept on using the .so library
files from the older version of MariaDB.  This behaviour is very, very
useful, but does lead to a bit of confusion at times.  When major
underlying things (such as the video drivers) get updated, the new
ones do not get used until after a reboot.  For MariaDB and MythTV,
the systemd setup does not cause MythTV to be shut down before a
MariaDB update can happen.  And MythTV is quite resilient - it will
handle the database going away and coming back again without raising
any alarms.  If it happens when there are no writes to the database,
there is no damage done.  But if it did want to write to the database,
this behaviour is problematic as all the database transactions that
happen when the database was down are lost, potentially leaving the
database logically corrupt, apart from not having those transactions
done.

It is possible to fix the systemd setup so that mythbackend will be
shut down before MariaDB can be shut down.  I think this is done by
putting this in the mythbackend .service file or an override file:

[Unit]
PartOf=mysql.service


More information about the mythtv-users mailing list