MyBB Community Forums

Full Version: Automatically Repair Crashed Tables
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
MyBB should really automatically repair crashed tables. It's annoying to wake up in the morning or get home from work and find your forums have been down for 10 hours because of a crashed sessions table or whatever.
ACP -> Task Manager -> Tables Check -> Enable
Eh, never really noticed that. But it's stupid either way. 99% of the time there's no need for it to run, and for the 1%, it could be up to an hour of downtime when it should just automatically repair then redirect, instead of show an error.
(2009-04-05, 05:43 AM)bobbit Wrote: [ -> ]Eh, never really noticed that. But it's stupid either way. 99% of the time there's no need for it to run, and for the 1%, it could be up to an hour of downtime when it should just automatically repair then redirect, instead of show an error.

Erm. What your suggesting is bad. Do you know how much more intensive it would be to check every single query for a "crashed" error report?

And then, if the table is big like 1-3+GB's big, then you'd ultimately end up crashing the entire server.

... And if your tables are crashing then you should be looking into asking your host why they run bad software, or whether or not your forum needs a dedicated server/more power, or other explanations for why your tables are crashing.
Eh, you don't have todo that. you can just check when there is a error report sent to the error class and check "what" the error is there, if it's a crash report, repair it.
Uhm, yeah you would have to do that. Either way, if an error is thrown you'd have to check it for a response like Ryan said.
Er. All you'd be doing is like if(error() == crashedtable()) dorepair(); (orange example but you get the point).

I really can't see how running the script every hour will make the server less likely to crash than running it when the error pops up...
As well the table shouldn't be crashing at all. And, as the database grows it will likely crash more often thus you will probably be using a lot server resources to repair it.
You would need to check each query that presents an error against that, and with ~100+ users possibly online at a time, yeah, you do the math.

Say it takes ~3 seconds to check it
~3*~100 = 300 seconds
300/60 = 5 minutes.

And obviously that's just an example, but trust me, it would make it run slower in the longhaul. Plus, what if multiple people get the error, and they all try repairing it? It will just cause more errors.
What table is crashing for you? If it's sessions you can fix that by changing the table to HEAP/MEMORY instead if MYISAM. HEAP tables when crashed will just empty and restart immediately. I have all my mybb forums using heap for sessions table.
Pages: 1 2 3