[mythtv-users] MySQL recordedseek regularly getting corrupted
Michael T. Dean
mtdean at thirdcontact.com
Thu Dec 1 12:28:32 UTC 2016
On 11/29/2016 06:13 PM, Jean-Yves Avenard wrote:
> I'm at my wit ends and it's something I have to fix rather regularly.
> Used to be every few months, now it can happen several times a week.
>
> When that happen, I can no longer seek in the file.
>
> running mysqlcheck gives me:
> mythconverg.recordedseek
> error : Can't create new tempfile: './mythconverg/recordedseek.TMD'
> status : Operation failed
>
>
> I have deleted the database, and restored from a backend last time.
> and now it has happen again.
>
> I see nothing particularly wrong with the /var/lib/mysql/mythconverg folder.
>
> permission of the folders are:
> drwx------ 1 mysql mysql 11698 Nov 30 10:00 .
>
> the recorded seek tables:
> -rw-rw---- 1 mysql mysql 8698 Nov 27 21:53 recordedseek.frm
> -rw-rw---- 1 mysql mysql 751934500 Nov 30 05:05 recordedseek.MYD
> -rw-rw---- 1 mysql mysql 688532480 Nov 30 10:00 recordedseek.MYI
> -rw-rw---- 1 mysql mysql 569909248 Nov 30 07:52 recordedseek.TMD
>
> last time I could repair the table with:
> myisamchk -r -f recordedseek.MYI
>
> But surely, I shouldn't have to do this on a weekly basis :(
>
> I deleted 3/4th of my recordings hoping to make the recordedseek table
> less big, but still.
>
> Any ideas would be greatly appreciated.
Looking back at your OP, it seems that the "Can't create new tempfile"
error is occurring only because you already have a TMD file there that's
owned by mysql user--I'm assuming you're running mysqlcheck as some
other user. You can delete (or rename) that file, then do a repair, and
then things should work properly (at least until one gets stuck,
again). Therefore, that error is probably not very important to the
overall issue (but probably more of a symptom of?)--so it's unfortunate
that's gotten so much focus.
The TMD file may have been created when someone ran a REPAIR or an
OPTIMIZE or by the "defragmenting" recently added to optimize_mythdb.pl
. Are you running that script? If so, I'd recommend running it only
manually (once a week or month or so, plus any time there's a MySQL
server crash) for a while to see if the system is more stable. If so,
then maybe try commenting out the defrag on that table, and see if
things are more stable.
As far as the size of your recordedseek files, it looks like there's
sufficient space for around 30M records, which would likely correspond
to about 15M seconds of video, meaning 4167 hours or 174 days (nearly 6
months) of video. I'm guessing this may be about what you had before
the purge? If so, it's possible the daily cleanup hasn't
succeeded--perhaps because of issues related to the existing tempfile?
Anyway, hope something in here helps. Good luck, and I hope you figure
out what's happening. You shouldn't be getting crashed tables anytime
other than when MySQL server crashes (and I hope that doesn't happen
frequently), or is shut off while in use (such as from a power loss).
Even with >30M records, MySQL (and MythTV) should be stable.
Mike
More information about the mythtv-users
mailing list