--source include/have_debug.inc --source include/have_log_bin.inc --source include/have_gtid.inc --source include/have_debug_sync_new.inc --source include/paxos.inc --disable_warnings show variables like "recovery_apply_binlog"; # crash_commit_before_log ---- before write binlog # crash_before_flush_binlog ---- before flush binlog but follower get binlog # crash_before_large_trx_commit_early ---- after sync binlog # crash_after_update_pos_before_apply -- before do commit in xa prepare # crash_after_do_commit_for_xa_prepare_in_mts -- after do commit in xa prepare --echo # --echo # DDL crash and recovery --echo # connection default; set debug = 'd, crash_commit_before_log'; # Write file to make mysql-test-run.pl restart the server --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --error 2013 create table t(id int); connection default; --enable_reconnect --source include/wait_until_connected_again.inc --disable_reconnect show tables; set debug = 'd, crash_before_large_trx_commit_early'; # Write file to make mysql-test-run.pl restart the server --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --error 2013 create table t(id int); connection default; --enable_reconnect --source include/wait_until_connected_again.inc --disable_reconnect show tables; --echo # --echo # Normal DML (1000) crash and recovery --echo # connection default; set debug = 'd, crash_commit_before_log'; # Write file to make mysql-test-run.pl restart the server --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --error 2013 insert into t values (1000); connection default; --enable_reconnect --source include/wait_until_connected_again.inc --disable_reconnect set debug = 'd, crash_before_flush_binlog'; # Write file to make mysql-test-run.pl restart the server --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --error 2013 insert into t values (1001); connection default; --enable_reconnect --source include/wait_until_connected_again.inc --disable_reconnect set debug = 'd, crash_before_large_trx_commit_early'; # Write file to make mysql-test-run.pl restart the server --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --error 2013 insert into t values (1002); connection default; --enable_reconnect --source include/wait_until_connected_again.inc --disable_reconnect select * from t; --echo # --echo # Xa Prepare crash and Rollback after recovery(2000) --echo # connection default; xa begin '2001'; insert into t values (2001); xa end '2001'; set debug = 'd, crash_commit_before_log'; # Write file to make mysql-test-run.pl restart the server --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --error 2013 xa prepare '2001'; connection default; --enable_reconnect --source include/wait_until_connected_again.inc --disable_reconnect xa recover; xa begin '2002'; insert into t values (2002); xa end '2002'; set debug = 'd, crash_before_large_trx_commit_early'; # Write file to make mysql-test-run.pl restart the server --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --error 2013 xa prepare '2002'; connection default; --enable_reconnect --source include/wait_until_connected_again.inc --disable_reconnect xa recover; xa rollback '2002'; select * from t; --echo # --echo # Xa Prepare crash and Commit after recovery(2000) --echo # connection default; xa begin '3001'; insert into t values (3001); xa end '3001'; set debug = 'd, crash_commit_before_log'; # Write file to make mysql-test-run.pl restart the server --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --error 2013 xa prepare '3001'; connection default; --enable_reconnect --source include/wait_until_connected_again.inc --disable_reconnect xa recover; xa begin '3002'; insert into t values (3002); xa end '3002'; set debug = 'd, crash_before_large_trx_commit_early'; # Write file to make mysql-test-run.pl restart the server --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --error 2013 xa prepare '3002'; connection default; --enable_reconnect --source include/wait_until_connected_again.inc --disable_reconnect xa recover; xa commit '3002'; select * from t; --echo # --echo # Xa Commit crash and recovery (4000) --echo # connection default; xa begin '4001'; insert into t values (4001); xa end '4001'; xa prepare '4001'; set debug = 'd, crash_commit_before_log'; # Write file to make mysql-test-run.pl restart the server --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --error 2013 xa commit '4001'; connection default; --enable_reconnect --source include/wait_until_connected_again.inc --disable_reconnect xa recover; set debug = 'd, crash_before_large_trx_commit_early'; # Write file to make mysql-test-run.pl restart the server --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --error 2013 xa commit '4001'; connection default; --enable_reconnect --source include/wait_until_connected_again.inc --disable_reconnect xa recover; select * from t; --echo # --echo # Xa Rollback crash and recovery (5000) --echo # connection default; xa begin '5001'; insert into t values (5001); xa end '5001'; xa prepare '5001'; set debug = 'd, crash_commit_before_log'; # Write file to make mysql-test-run.pl restart the server --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --error 2013 xa rollback '5001'; connection default; --enable_reconnect --source include/wait_until_connected_again.inc --disable_reconnect xa recover; set debug = 'd, crash_before_large_trx_commit_early'; # Write file to make mysql-test-run.pl restart the server --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --error 2013 xa rollback '5001'; connection default; --enable_reconnect --source include/wait_until_connected_again.inc --disable_reconnect xa recover; select * from t; --echo # --echo # Crash happened on XA COMMIT ONE PHASE (5500) --echo # connection default; xa begin '5501'; insert into t values (5501); xa end '5501'; set debug = 'd, crash_commit_before_log'; # Write file to make mysql-test-run.pl restart the server --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --error 2013 XA COMMIT "5501" ONE PHASE; connection default; --enable_reconnect --source include/wait_until_connected_again.inc --disable_reconnect connection default; xa begin '5502'; insert into t values (5502); xa end '5502'; set debug = 'd, crash_before_large_trx_commit_early'; # Write file to make mysql-test-run.pl restart the server --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --error 2013 XA COMMIT "5502" ONE PHASE; connection default; --enable_reconnect --source include/wait_until_connected_again.inc --disable_reconnect select * from t; --echo # --echo # Xa with binlog And DDL Crash (6000) --echo # connection default; create table t1(id int); create table t2(id int); flush logs; --connect (con101,127.0.0.1,root,,test,$MYPORT_1) --connect (con102,127.0.0.1,root,,test,$MYPORT_1) --connect (con103,127.0.0.1,root,,test,$MYPORT_1) connection con101; xa begin '6001'; insert into t1 values (6001); xa end '6001'; SET DEBUG_SYNC= 'sync_before_commit_stage_in_order_commit WAIT_FOR no_signal'; send xa prepare '6001'; connection con103; create table t3(id int); connection con102; xa begin '6002'; insert into t2 values (6002); xa end '6002'; SET DEBUG_SYNC= 'sync_before_commit_stage_in_order_commit WAIT_FOR no_signal'; send xa prepare '6002'; connection con103; --replace_column 1 # set debug = 'd, crash_before_large_trx_commit_early'; # Write file to make mysql-test-run.pl restart the server --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --error 2013 drop table t3; connection con101; --error 2013 reap; connection con102; --error 2013 reap; connection default; --enable_reconnect --source include/wait_until_connected_again.inc --disable_reconnect xa recover; --disconnect con101 --disconnect con102 --disconnect con103 --connect (con101,127.0.0.1,root,,test,$MYPORT_1) --connect (con102,127.0.0.1,root,,test,$MYPORT_1) --connect (con103,127.0.0.1,root,,test,$MYPORT_1) connection con101; SET DEBUG_SYNC= 'sync_before_commit_stage_in_order_commit WAIT_FOR no_signal'; send xa commit '6001'; connection con102; SET DEBUG_SYNC= 'sync_before_commit_stage_in_order_commit WAIT_FOR no_signal'; send xa commit '6002'; connection con103; create table t3(id int); set debug = 'd, crash_before_large_trx_commit_early'; # Write file to make mysql-test-run.pl restart the server --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --error 2013 drop table t3; connection default; --enable_reconnect --source include/wait_until_connected_again.inc --disable_reconnect show tables; --disconnect con101 --disconnect con102 --disconnect con103 --echo # --echo # Xa And DML Crash (7000) --echo # --connect (con101,127.0.0.1,root,,test,$MYPORT_1) --connect (con102,127.0.0.1,root,,test,$MYPORT_1) --connect (con103,127.0.0.1,root,,test,$MYPORT_1) connection con101; xa begin '7001'; insert into t1 values (7001); xa end '7001'; SET DEBUG_SYNC= 'sync_before_commit_stage_in_order_commit WAIT_FOR no_signal'; send xa prepare '7001'; connection con102; xa begin '7002'; insert into t2 values (7002); xa end '7002'; SET DEBUG_SYNC= 'sync_before_commit_stage_in_order_commit WAIT_FOR no_signal'; send xa prepare '7002'; connection con103; insert into t1 values (7003); insert into t2 values (7003); set debug = 'd, crash_commit_before_log'; # Write file to make mysql-test-run.pl restart the server --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --error 2013 insert into t2 values (7004); connection con101; --error 2013 reap; connection con102; --error 2013 reap; connection default; --enable_reconnect --source include/wait_until_connected_again.inc --disable_reconnect xa recover; --disconnect con101 --disconnect con102 --disconnect con103 --connect (con101,127.0.0.1,root,,test,$MYPORT_1) --connect (con102,127.0.0.1,root,,test,$MYPORT_1) --connect (con103,127.0.0.1,root,,test,$MYPORT_1) connection con101; SET DEBUG_SYNC= 'sync_before_commit_stage_in_order_commit WAIT_FOR no_signal'; send xa commit '7001'; connection con102; SET DEBUG_SYNC= 'sync_before_commit_stage_in_order_commit WAIT_FOR no_signal'; send xa commit '7002'; connection con103; insert into t1 values (7005); insert into t2 values (7005); set debug = 'd, crash_commit_before_log'; # Write file to make mysql-test-run.pl restart the server --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --error 2013 insert into t2 values (7006); connection con101; --error 2013 reap; connection con102; --error 2013 reap; connection default; --enable_reconnect --source include/wait_until_connected_again.inc --disable_reconnect xa recover; select * from t1; select * from t2; --disconnect con101 --disconnect con102 --disconnect con103 --echo # --echo # Follower apply xa prapare Crash (8000) --echo # --connect (con101,127.0.0.1,root,,test,$MYPORT_1) --connect (con102,127.0.0.1,root,,test,$MYPORT_1) --connect (con2,127.0.0.1,root,,test,$MYPORT_2) connection con2; set global debug = 'd, crash_after_update_pos_before_apply'; stop xpaxos_replication; start xpaxos_replication; # Write file to make mysql-test-run.pl restart the server --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect connection con101; xa begin '8001'; insert into t1 values (8001); xa end '8001'; xa prepare '8001'; connection con102; --source include/wait_follower_catchup.inc connection con2; --error 2013 xa recover; --enable_reconnect --source include/wait_until_connected_again_old.inc --disable_reconnect xa recover; connection con101; xa commit '8001'; connection con2; set global debug = 'd, crash_after_do_commit_for_xa_prepare_in_mts'; stop xpaxos_replication; start xpaxos_replication; # Write file to make mysql-test-run.pl restart the server --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect connection con101; xa begin '8002'; insert into t1 values (8002); xa end '8002'; xa prepare '8002'; connection con102; --source include/wait_follower_catchup.inc connection con2; --error 2013 xa recover; --enable_reconnect --source include/wait_until_connected_again_old.inc --disable_reconnect xa recover; connection con101; xa commit '8002'; delete from t1; --disconnect con101 --disconnect con102 --disconnect con2 --echo # --echo # Follower apply xa commit Crash (9000) --echo # --connect (con101,127.0.0.1,root,,test,$MYPORT_1) --connect (con102,127.0.0.1,root,,test,$MYPORT_1) --connect (con2,127.0.0.1,root,,test,$MYPORT_2) connection con101; xa begin '9001'; insert into t1 values (9001); xa end '9001'; xa prepare '9001'; connection con2; set global debug = 'd, crash_on_external_xa_commit'; stop xpaxos_replication; start xpaxos_replication; # Write file to make mysql-test-run.pl restart the server --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect connection con101; xa commit '9001'; connection con102; --source include/wait_follower_catchup.inc connection con2; --error 2013 select * from t1; --enable_reconnect --source include/wait_until_connected_again_old.inc --disable_reconnect --source include/wait_apply_catchup.inc select * from t1; --disconnect con101 --disconnect con102 --disconnect con2 connection default; drop table t, t1, t2; --enable_warnings