3 # This file is an engine to process commands like
4 # rpl_mixing_engines.inc. It has the same set of commands, and in
5 # addition the extra command 'recovery'. The 'configure' and 'clean'
6 # commands are also extended version of the same commands in
7 # rpl_mixing_engines.inc.
11 # --let $commands= command1 command2 ...
12 # --let $database_name= name
13 # --let $failure= d,debug_flag
15 # --source include/rpl_mixing_engines.inc
19 # $commands, $database_name, $verbose
20 # See rpl_mixing_engines.inc.
23 # This debug symbol will be set. See the implementation for
26 # ==== Implementation ====
28 # This file has its own code for 'configure' and 'clean'. For other
29 # commands, this file first configures the server according to
30 # $failure, and then delegates the commands to rpl_mixing_engines.inc.
33 # Creates tables used throughout the test and changes the type of the
34 # mysql.slave_relay_log_info to Innodb.
36 if ($commands ==
'configure')
38 --sync_slave_with_master
39 --source include/stop_slave.inc
40 SHOW CREATE
TABLE mysql.slave_relay_log_info;
41 SHOW CREATE
TABLE mysql.slave_worker_info;
42 ALTER
TABLE mysql.slave_relay_log_info ENGINE= Innodb;
43 ALTER
TABLE mysql.slave_worker_info ENGINE= Innodb;
44 SHOW CREATE
TABLE mysql.slave_relay_log_info;
45 SHOW CREATE
TABLE mysql.slave_worker_info;
46 --source include/start_slave.inc
49 --source
extra/rpl_tests/rpl_mixing_engines.inc
51 --sync_slave_with_master
57 # Cleans the test case by deleting all tables, triggers, procedures and
58 # functions that were created.
60 if ($commands ==
'clean')
63 --source
extra/rpl_tests/rpl_mixing_engines.inc
68 # Executes the set of commands defined in $command by calling
69 # rpl_mixing_engines.inc
74 # If an fault injection point was defined, stop the SQL THREAD and
75 # prepare the slave to be restarted. Otherwise, do nothing.
80 STOP SLAVE SQL_THREAD;
81 source include/wait_for_slave_sql_to_stop.inc;
82 --eval SET GLOBAL debug=
"$failure";
83 --exec echo
"wait" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
87 # Prints the expected outcome after the recovery. Check the
88 # WL#4801 for further details.
94 if ($failure !=
'd,crash_after_commit_and_update_pos')
96 if ($failure !=
'd,crash_after_apply')
101 --echo FAILURE $failure and OUTCOME $outcome
105 # Executes the set of commands defined in $command by calling
106 # rpl_mixing_engines.inc
109 let $master_before= query_get_value(SHOW MASTER
STATUS, Position, 1);
110 --source
extra/rpl_tests/rpl_mixing_engines.inc
111 let $master_after= query_get_value(SHOW MASTER
STATUS, Position, 1);
114 # Restarts the SQL THREAD and waits for the SLAVE to be crashed and
122 START SLAVE SQL_THREAD;
123 --source include/wait_until_disconnected.inc
124 --exec echo
"restart" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
125 --let $rpl_server_number= 2
126 --source include/rpl_reconnect.inc
128 --let $slave_before= `SELECT master_log_pos FROM mysql.slave_relay_log_info`
130 source include/wait_for_slave_to_start.inc;
134 # Syncs the slave with the master and checks if the slaves applied all
135 # changes from the master and is not out of sync.
138 sync_slave_with_master;
140 --let $slave_after= `SELECT master_log_pos FROM mysql.slave_relay_log_info`
141 if ($slave_after != $master_after)
143 --echo Slave is out of sync.
144 --echo MASTER_BEFORE $master_before MASTER_AFTER $master_after SLAVE_BEFORE $slave_before SLAVE_AFTER $slave_after
146 --source include/show_rpl_debug_info.inc