About a week and a half ago, a small site that a friend of mine runs suffered an unfortunate problem...and to further strengthen our relationship, it is on a server that i am responsible for (sorry big guy).

anyway, the specs on the server are:
  • PIII 600mhz
  • 30gb IDE
  • Slackware 9.0 (using ReiserFS on the partition in question)
  • Apache 1.3.29
  • PHP5.0.0.RC2
  • MySQL 4.0.18

the site itself is totally custom (a forum, some polls, etc...typical community site), but the app in question is a simple blog. it stores all it's data in a single table (MyISAM) and it had entries that were created throughout the month of may.

so when the power went out last week, everything was down for about 2 or 3 minutes. when the server came back up, several weeks worth of blog entries had apparently vanished, though all the other apps seemed fine. i thought there may have been an error in one of his admin scripts that may have accidentally deleted the records, but he said he hadn't touched anything for the past day, although we both knew those entries had been on the site that morning.

after looking though the syslog on the server, i saw where there were a number of filesystem errors and warnings, and reiserfs had to replay several transactions (10 uncompleted unlinks/truncates, whatever that means).

then i took a look at the last modified date on the .MYD file for the mysql table in question, and it apparently had not been touched in a month, while all the other files had been modified at MOST in the last 2 days.

so my question is: is it safe to assume that the power outage just happened to occurred at a bad time for mysql? or better, is mysql really that sketchy about writing data to disk?

another question (though it may not be appropriate to ask it here) is:
could ReiserFS have seen that the file was corrupt and then actually rolled it back to the last non-corrupt version it knew of?

luckily the server and the site are all just for experimentation and hobby, so nobody's money/job was lost. oh, and the lesson learned? backup mysql on a regular basis.