[mythtv-users] INSERT INTO recordedmarkup fails w/duplicate; recording status changes
Stephen Worthington
stephen_agent at jsw.gen.nz
Sun Apr 9 11:07:29 UTC 2023
On Sun, 9 Apr 2023 10:32:25 +0200, you wrote:
>In order to exclude the possibility of database corruption, could you
>check/repair the database?
>
>https://www.mythtv.org/wiki/Database_errors
Yes, it is likely a corrupt recordedseek table. That is the table
that is almost certain to be damaged if there is a crash or lockup or
reboot done while a program is recording. Whenever your system is not
shut down cleanly, you must always check all the database tables
before starting any new recordings. The easiest way to do that is to
just manually run the automated check and repair that should be being
done automatically by anacron every day:
/etc/cron.daily/optimize_mythdb
Use sudo to run that file.
If you do not have that file installed, you should fix that by copying
the original version, which can be found here in the Ubuntu packages:
/usr/share/doc/mythtv-backend/contrib/maintenance/optimize_mythdb.pl
The optimize_mythdb script should be run when no recordings are in
progress, so if you run it manually, you should probably shut down
mythbackend first. Once it completes and says it has fixed the
recordedseek table (and any other damaged tables), you can restart
mythbackend, and then you will need to run mythcommflag --rebuild on
any recordings made since the recordedseek table was damaged. If you
do commercial skip processing, you will also need to run that again
for those recordings, after running --rebuild. Find the mythcommflag
settings you are using in:
mythtv-setup > 1. General > Job Queue (Global) > Advert-detection
command
and run that command against each recording file. To specify one
recording file to mythcommflag, use its "--chanid" and "--starttime"
options.
Note that successfully repairing the database tables requires that you
have sufficient free space on the partition where the mythconverg
database is stored to make copies of the largest table's files. The
largest table is almost always recordedseek. Use this command to see
what the largest tables are:
sudo ls -alS /var/lib/mysql/mythconverg/ | head -n 20
and this to see how much space the recordedseek tables use:
sudo du -hc /var/lib/mysql/mythconverg/recordedseek*
Debian may put the files in different places from Ubuntu, so check the
locations.
More information about the mythtv-users
mailing list