http://www.perlmonks.org?node_id=848857


in reply to Site back up again

(THANK YOU)^5

Thank ALL of you who were involved.

Can I trouble you for a couple more pieces of information? Can you list the Monks involved in the recovery, that I may say appropriate novenas for them? And can you give more detail on what went wrong with the database? There are not a few of us in the Monastery who use MySQL in the Real World, and I, at least, would like to know what happened in detail so I can look at setting up counter-measures.

----
I Go Back to Sleep, Now.

OGB

Replies are listed 'Best First'.
Re^2: Site back up again
by Corion (Patriarch) on Jul 11, 2010 at 21:59 UTC

    The database server suffered some corruption of its MyISAM tables. This was discovered and acted on by Pair. The only active involvement by tye, yitzhack and me was to decide that one particularly large table should not be restored. That table was for request statistics, so we've lost the access statistics per page, but that's a small price to pay.

    I'm not sure what caused the table corruption. It became very manifest after I restarted the MySQL server, but maybe that was also what caused the corruption in the first place. Maybe it can be discovered earlier by frequently running show table status $table and/or check table $table.

    As the recovery process employed by MySQL/myisamchk respectively repair $table seemed to be mostly rebuilding the MyISAM index from the raw table file, future decisions will likely weigh the recency of the last backup, as filling the database from a backup is much faster than rechecking/repopulating the table by scanning a MyISAM file.

    Update: Added a crucial "maybe" in the first sentence of the second paragraph.

Re^2: Site back up again
by CountZero (Bishop) on Jul 12, 2010 at 08:04 UTC
    I suffered a similar problem with MySQL very recently. During a routine adding of new records to our database and updating old records, my computer (Windows XP) crashed and seemed to have left some of the index tables in disarray.

    After that reading of some records failed for no obvious reason with a so<mewhat helpful error message ("[ERROR] C:\data\Program Files\MySQL\MySQL Server 5.1\bin\mysqld: Incorrect key file for table '.\pandirecords\claims.MYI'; try to repair it"). Running the full check and repair suite fixed it in less than an hour (in total about 600,000 records in that database).

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James