[mythtv-users] './mythconverg/recordedseek' is marked as crashed

Stephen Worthington stephen_agent at jsw.gen.nz
Wed Jul 29 03:17:38 UTC 2015


On Wed, 29 Jul 2015 03:50:46 +0200, you wrote:

>Hoi All,
>
>It seems my recordedseek table is crashed. What do I do now?
>Backups return empty and optimize_mythdb.pl fails.
>It seems to have happened a few days ago since the last backup with
>content was from almost a week ago.
>For the rest everything works. I can record, watch, schedule. That's
>why I didn't notice at first.
>
>I guess I somehow have to dump the table and recreate it. Which will
>take a long time. (some 3.4 Tb in recordings )

This is what backups are for.  If you restore just that table from
backup, that gets around having to recreate the entries for most of
your recordings.  Then you would need to do some SQL to get a list of
the new recordings that need to have their recordedseek entries
created.  Something like this query should work:

select r.chanid,r.starttime,r.basename from recorded r left join
recordedseek rs on r.chanid=rs.chanid and r.starttime=rs.starttime
where r.chanid is null;

Then run mythcommflag --rebuild (or a full commercial flagging) on
each of the new recordings identified by that query.

And also check for the recordedseek entries still present belonging to
recordings that have been deleted.  This might work, but will take a
long time to run on a large database:

select rs.chanid,rs.starttime from recordedseek rs where not exists
(select 'x' from recorded r where r.chanid=rs.chanid and
r.starttime=rs.starttime);

There is probably a more efficient query using left outer join.  Then
you would need to delete all those entries the query listed.

If the existing crashed recordedseek table can be repaired, it might
be easier to try that first.  A google for "mysql repair table" tells
you how to do that.  If it can be repaired, you can then run the
queries above to see how much damage has been done and see if it might
be better to just restore the backup table.

Restoring one table from a backup is a bit of a pain.  You need to
copy the backup file somewhere with enough disk space, uncompress it,
and use a powerful text editor that can handle files that huge to edit
out all of the other table backups except for the recordedseek one.
Most text editors do not handle multi-gigabyte text files at all well.

Then run just the recordedseek SQL from the backup file as a mysql
command (eg using source to run the file).


More information about the mythtv-users mailing list