The pitfalls of a dynamic site

One of my biggest fears in switching from Movable Type to WordPress was what would happen if my database got FUBAR’ed. With Movable Type and its default static rebuilds, you’ll lose commenting and editing until it’s fixed, but the site would still appear normal to the world.

This afternoon, I experienced exactly what I was afraid of. My website would only half load with a cryptic error of:

“WordPress database error: [Got error 12 from storage engine]

SELECT DISTINCT * FROM wp_posts WHERE 1=1 AND post_date_gmt <= '2007-01-03 19:03:59' AND (post_status = "publish") AND post_status != "attachment" GROUP BY wp_posts.ID ORDER BY post_date DESC LIMIT 0, 10"

Worse, where the the content should be it only said “No entries”.

I quickly found this page on the WordPress support forums, which point the finger at the host server.

While I was on hold waiting for Media Temple tech support, I ran repair on the MySQL tables and got this:

db1971_wp.wp_ak_404_log repair status OK

db1971_wp.wp_ak_popularity repair status OK

db1971_wp.wp_ak_popularity_options repair status OK

db1971_wp.wp_categories repair status OK

db1971_wp.wp_comments repair status OK

db1971_wp.wp_linkcategories repair status OK

db1971_wp.wp_links repair status OK

db1971_wp.wp_options repair error Not enough memory for blob at 7352 (need 41079)

db1971_wp.wp_options repair error Not enough memory for blob at 7352 (need 41079)

db1971_wp.wp_options repair status Operation failed

db1971_wp.wp_post2cat repair status OK

db1971_wp.wp_postmeta repair status OK

db1971_wp.wp_posts repair error Not enough memory for blob at 881440 (need 9701)

db1971_wp.wp_posts repair error Not enough memory for blob at 881440 (need 9701)

db1971_wp.wp_posts repair status Operation failed

db1971_wp.wp_usermeta repair status OK

db1971_wp.wp_users repair status OK

Now I wasn’t even getting a partial page. momathome.com just gave a message along the lines of “looks like WordPress isn’t installed.”

#$@%^^#@

To my relief, I learned today that MySQL repairs are like when you run disk repairs on a hard drive. You have to keep doing it until you get a clean report. The repair had to run 3 times, but in the end it’s fine.

Media Temple support suggested I cache pages to ease load on the database, which I’m starting to do with the wp-cache plugin. I haven’t tweaked any of the settings, but so far it appears to be doing its thing.

It just so happens that I had backed up the database last night. I think that will become my nightly routine.

It wasn’t that big a problem, but it was enough to bring down the entire site and my understanding of MySQL is minimal at best. Each experience is a learning one, I guess.

Advertisements