Bug #60343 where are the crash recovery tests?
Submitted: 4 Mar 2011 16:39 Modified: 13 Sep 2011 19:21
Reporter: Mark Callaghan Email Updates:
Status: Verified Impact on me:
Category:MySQL Server: Tests Severity:S3 (Non-critical)
Version:5.5 OS:Any
Assigned to: CPU Architecture:Any
Tags: crash, mtr, recovery

[4 Mar 2011 16:39] Mark Callaghan
Where are the mtr tests for crash recovery to confirm that InnoDB and InnoDB+binlog do the right thing for crash recovery? The only test today is t/crash_commit_before.test that crashes an InnoDB transaction prior to commit. There are no other tests for InnoDB. Nor are there tests to confirm that XA recovery does the right thing for InnoDB+binlog.

/s/src/mysql-5.5.8/mysql-test] find . -type f -print | xargs grep half_binlog

/s/src/mysql-5.5.8/mysql-test] find . -type f -print | xargs grep crash_commit
./r/crash_commit_before.result:SET SESSION debug="d,crash_commit_before";
./t/crash_commit_before.test:SET SESSION debug="d,crash_commit_before";

There are several debug events that can be used to crash mysqld at interesting times:

/s/src/mysql-5.5.8/mysql-test] grep DBUG_SUICIDE ../sql/*.cc
../sql/handler.cc:    DBUG_EXECUTE_IF("crash_commit_before", DBUG_SUICIDE(););
../sql/handler.cc:      DBUG_EXECUTE_IF("crash_commit_after_prepare", DBUG_SUICIDE(););
../sql/handler.cc:      DBUG_EXECUTE_IF("crash_commit_after_log", DBUG_SUICIDE(););
../sql/handler.cc:    DBUG_EXECUTE_IF("crash_commit_before_unlog", DBUG_SUICIDE(););
../sql/handler.cc:    DBUG_EXECUTE_IF("crash_commit_after", DBUG_SUICIDE(););
../sql/log.cc:      DBUG_EXECUTE_IF("half_binlogged_transaction", DBUG_SUICIDE(););

How to repeat:
Read the code

Suggested fix:
add tests
[3 Aug 2011 3:32] Mark Callaghan
DDL on partitioned tables also need crash recovery tests given the use of the DDL log
[3 Aug 2011 3:39] Mark Callaghan
We also needs crash recovery tests for the replication master. When slave replication state is crash proof, tests will also be needed for that.
[13 Sep 2011 19:21] Mark Callaghan
Non-portable crash tests are in the FB patch: