UBB.Dev
Posted By: blaaskaak Auto repair table - 07/19/2008 11:39 AM
My board was down yesterday because of a crashed table.

I am thinking about modding the board to auto repair any crashed table, but I am curious if the experts have any comment on it.

Easiest to code would be in the errorhandler itself, just do a regex like "Table '\./(\w+)/(\w+)' is marked as crashed and should be repaired" on the error message, and do a repair table. But repairing takes a bit of time, and it wouldn't be smart to issue out several repair tables.

The option I have in mind is that the error handler would just write out a repair table sql statement to a file, and a cronjob would do any sql statements in that file, and clear that file afterwards.

Any comments on this? Or is it just plain stupid to try to auto repair.
Posted By: sirdude Re: Auto repair table - 07/19/2008 7:07 PM
i'd also be wary of the specific table name. for example, if it's one of the big ones, then you'd want to have your cron change config.inc.php to close the board, while repairing.

posts, topics, privatemessages, users.. come to mind..
Posted By: blaaskaak Re: Auto repair table - 07/20/2008 1:16 AM
closing the board is something I had in mind too, but I would close it always. If the table is small, the closing will be over quick anyway.
© UBB.Developers