CDR table corruption

I’ve inherited working on a FreePBX box. Note: I did do search on this topic first, but nothing jumped out at me as a solution.

Here is the issue. We are having a random lockup, that seems to be tied to the CDR table.

Here is what happens. The CDR table becomes corrupted. MySQL starts logging this fact in the log file to the tune of about 4 lines every 5 seconds. Pretty soon, the log file is huge. At this point the phone system randomly locks up with a fast busy signal. The system can be rebooted and it runs for a day or so and then locks up with a fast busy again.

I can go into MySQL and repair the table. I then delete or rename the huge log file, and the FreePBX box will now run for a week or two (or three), but as soon as it starts hanging with the fast busy again, I have to log back in and repair the CDR table and delete the log file again.

I’m under orders to get this fixed, or to come up with another solution.

Personally, I’m open to either solution.

My suggestion would be this:

  1. Dump the present table with mysqldump
  2. Drop the table, restart mysql
  3. Create a new CDR table

If the problems continue I would do a fsck on the file system,