On 11/6/07, mos <[EMAIL PROTECTED]> wrote:
>
> At 02:18 PM 11/6/2007, Richard Edward Horner wrote:
> >Hi,
> >
> >I'm working on a program that will run in the event that tables are
> >crashed or corrupt. Can anyone recommend a good method for crashing my
> >tables or corrupting them so I have some test cases? I'm mostly
> >interested in MyISAM and InnoDB table types.
> >
> >I was thinking I would just start an infinite loop with an UPDATE
> >statement in it and then kill -9 the mysqld process.
> >
> >Any better ideas?


Well, there are different types of corruption.  Here are a few that come to
mind:

a)Corruption of a MySQL file, perhaps not repairable (disk hardware problem,
OS crash, server power supply failure).

b)Corruption in a way that is repairable by a MySQL utility (index file
corrupted).

c)Application corruption (bad application doesn't handle mutual exclusion
correctly, has logical errors, etc.).

Hopefully database repair utilities that come with MySQL will map (a) and
(b) to be indistinguishable from (c).  (But I don't know that--I'm barely a
MySQL user.)

The most even-handed way to do it would seem to be:

a)Write a program that will create a random number of distributed and block
corruptions distributed randomly in the MySQL files.  (Such a program would
take very little time to execute--well under half a second, I'm guessing.)
You might want to throw in truncations and blocks added at the end of files,
too.

b)See how far the MySQL utilities (if there are any) followed by your
software will go towards repair.

Doesn't seem like an easy thing to test.

Reply via email to